Signature
stock xs_strchr(const str[], chr){ for(new i = 0; str[i] != 0; ++i) { if(str[i] == chr) return i; } return -1;}
Description
Finds a character in a string and returns its position in the string.
Parameters
- str — The string to search in.
- chr — The character to search for in the string.
Returns
The character position if found, -1 otherwise.