Hi
I have to read and process some strings, written on an Ascii file. The string is in the form:
xxx yyy zzz number
To separate the "number", I am using LastIndexOf(" "), because the number is after the last space (of course I have trimmed the string after reading and before processing it).
I had the bad surprise to see that this function fails when inside the string I have special characters, but, Unluckily, not all of them, and also the failure is nonsense.
For example the string:
s="Alfaquiques/Sacário 20"
is processed correctly, while for the string:
s="Ribeira do Falcão 34"
LastIndexOf(s) returns 10 which is not correct. Actually 10 is nonsense and maybe the problem is not related to the presence special characters and I have hidden characters (the file was copied from a computer).
Any idea?
Thanks in advance
I have to read and process some strings, written on an Ascii file. The string is in the form:
xxx yyy zzz number
To separate the "number", I am using LastIndexOf(" "), because the number is after the last space (of course I have trimmed the string after reading and before processing it).
I had the bad surprise to see that this function fails when inside the string I have special characters, but, Unluckily, not all of them, and also the failure is nonsense.
For example the string:
s="Alfaquiques/Sacário 20"
is processed correctly, while for the string:
s="Ribeira do Falcão 34"
LastIndexOf(s) returns 10 which is not correct. Actually 10 is nonsense and maybe the problem is not related to the presence special characters and I have hidden characters (the file was copied from a computer).
Any idea?
Thanks in advance