07.12.2018, 13:40
You need to loop from position 0 until string's length-1.
Check each character if it is in range of 'a' to 'z' OR 'A' to 'Z' using array index (in example text[i]).
But it is better to do it the other way around. If a character is not a letter, return 0 right away to avoid needless loop iterations.
Check each character if it is in range of 'a' to 'z' OR 'A' to 'Z' using array index (in example text[i]).
But it is better to do it the other way around. If a character is not a letter, return 0 right away to avoid needless loop iterations.