How to extract a letter out of a string?
Posted: Wed May 03, 2006 12:53 pm
I have a string variable: let's say: NAME.
For instance, suppose NAME equals "andrew smith"
A would like to get the 1st letter of NAME (here 'a') and put it in the variable LETTER1 (also declared as a string in GE)
Unfortunately, the following code does not seem to work:
char LETTER1 = NAME[0];
This lead to the following error message: "Incompatible types: cannot convert from 'char' to 'ARY[256]char'.
Why?
Many thanks for your help.
Regis
For instance, suppose NAME equals "andrew smith"
A would like to get the 1st letter of NAME (here 'a') and put it in the variable LETTER1 (also declared as a string in GE)
Unfortunately, the following code does not seem to work:
char LETTER1 = NAME[0];
This lead to the following error message: "Incompatible types: cannot convert from 'char' to 'ARY[256]char'.
Why?
Many thanks for your help.
Regis