check if a char is a space java
if (c == ' ')
check if a char is a space java
if (c == ' ')
count spaces in string java
/* let string is s*/
void countSpace(std::string s)
{
int len=s.size(); int c=0;
for(int i=0;i<len;i++)
if(s[i]==' ') c++;
cout<<"Total Number of spae in give string is "<<c;
}
/**************************************************************************
If the user already know the total number of words that string have
then total_number_of_space_in_string = total_number_of_words_in_string - 1;
***************************************************************************/
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us