Blurtit.
  • Ask
  • Topics
  • Discover
  • Sign in
  • Latest
answered question 5/2/2009
Program In Java To Accept A String And Find The Number Of Blank Spaces In The String?
import java.io.*;
public class count
{
public static void main(String[]args)
{
String str = "this is my computer";
int count = 0;
int limit = str.length();
for(int I = 0; I < limit; I++)
{   
if(Character.isWhitespace(str.charAt(I))   
{       
++count;   
}
}
  • 1 Answer
  • Follow
  • Blurt
  • Favorite
  • 0
  • 0
  • 0
followed this question.
blurted this answer.
favorited this question.
Follow
  • 1 Answers
  • 0 Thanks
  • 0 Following
  • 0 Followers

Questions

  • Ask
  • Topics
  • Discover

Company

  • About
  • Contact
  • Support

Everything Else

  • Terms Of Use
  • Privacy Policy
  • Cookie Policy

Follow Us

Social Networks

  • Blurtit on Facebook
  • Blurtit on Twitter
  • Blurtit on Google+
Blurtit.

© Blurtit Ltd. All rights reserved.

x