Xojo’s Trim() is too good. It trims all whitespace codes including tabs. I only want to trim blanks (ASCII 32). What code do you recommend?
You can supply String.Trim which characters you want to remove:
Trim(Optional ParamArray characters() As String) As String
Returns the String passed with either whitespaces or the characters passed removed from the beginning and ending of the String.
I recommend you read the documentation.
Hi Richard and Tim: Yes, thank you.
I do not found alternative to a good old replace for multiple spaces inside a sentence (line John Doe).
If you are dealing with DataBase (SQLite for example) and the user full name is John Winston Lennon
and by error, forget a space, and create a Record, then that user place two spaces and modify the Record, the Data Base will have TWO records with nearly the “same” information (apparently).
Idiot proof software does not exists; better idiots exists (they adapt themselves !).
Are you using RegEx to replace multiple spaces or something else?
No. Only Replace Two spaces with One space. The text comes from the Keyboard or Paste, so ASCII 32. In TextField.