Question: Is there a Query or way in MySql to delete whitespaces in-between a String ?  

For Example - If I've a String **'Auto Robot Cars'** , the result should be 
**'AutoRobotCars'**   

I'm aware of TRIM function in MySql but it only deletes Leading & Trailing spaces not the WhiteSpaces in-between the String.

Answer: 
Use a `TextFormatter` with `UnaryOperator` and `StringConverter<Integer>` as shown below:

```
UnaryOperator<TextFormatter.Change> filter = change -> change.getControlNewText().matches("[0-3]?\\p{XDigit}{0,3}") ? change : null;

StringConverter<Integer> converter = new StringConverter<Integer>() {

    @Override
    public String toString(Integer object) {
        return object == null ? "" : Integer.toHexString(object);
    }

    @Override
    public Integer fromString(String string) {
        return string == null || string.isEmpty() ? null : Integer.parseInt(string, 16);
    }

};

TextFormatter<Integer> formatter = new TextFormatter<>(converter, null, filter);
textField.setTextFormatter(formatter);

```

The converted value is available via `TextFormatter.value` property. It only gets updated on pressing enter or the `TextField` loosing focus.
An idea may be to parse it into integer format first. You can use:

`int value = Integer.decode("your hex value here");`

if the string is not a proper value, it will throw a number format exception, however the decode function will also work for any valid integer (so something base 10 will work as well in this case).

An alternative you could try is:

`int value = Integer.parseInt("hex value",16)`

However for this method you will need to get rid of the "0x" header from your String

Since you are performing a check, surround it with a `try catch` block and whatever is caught would be an improperly formatted hex.

Furthermore if you need to check whether the value is between 0 to 16383, just use the value returned by the methods above.