Horje
count spaces in string java Code Example
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;
***************************************************************************/




Cpp

Related
pass map as reference c++ Code Example pass map as reference c++ Code Example
gamemaker studio Code Example gamemaker studio Code Example
temperature conversion in c++ Code Example temperature conversion in c++ Code Example
how to use a non const function from a const function Code Example how to use a non const function from a const function Code Example
return use in c++ Code Example return use in c++ Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8