only letters
#2

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.
Reply


Messages In This Thread
only letters - by Kraeror - 07.12.2018, 13:12
Re: only letters - by Calisthenics - 07.12.2018, 13:40
Re: only letters - by Kraeror - 07.12.2018, 14:15
Re: only letters - by Logic_ - 07.12.2018, 16:00
Re: only letters - by Kraeror - 08.12.2018, 20:25
Re: only letters - by Kraeror - 08.12.2018, 20:34

Forum Jump:


Users browsing this thread: 1 Guest(s)