Hi :-)
Yeah I'm new to this whole thing, that's why I'm probably going to ask a lot of stupid questions, I apologize in advance..
The story is: I'm writing a program to enter a string and a search character and output the number of times this character occured in the string.
// s for string and c for search character
int i = 0;
int result = 0; //number of occurences
for(i = 0; i < s.length(); i++)
{
if (s.charAt(i) == c) //
result++;
}
Everything is fine, but I haven't got a clue how to handle the situation where the search character is a space (or other special characters i guess)..
Thanks for the help :-)