Return the first occurrence of a character within a string.
Syntax: index,code = strChr(string,char)
|
string |
Required. The string to be searched |
|
char |
Required. The character to search for |
| index | Required. The location within the string that char occurred, starting at 0. This is a uByte. |
| code | Optional. If the character is not found in the string, this returns 1 and index will return 0 |
Example:
Dim s(10) as String, x as uByte, y as uByte s="testing" x,y=StrChr(s,"s") ' x=2 y=0 x,y=StrChr(s,"z") ' x=0 y=1
Also See: