how to check where the last char is in a string c

C
strlen(str);
Source

Also in C: