answersLogoWhite

0

....

String line = "This is example program with spaces";

String[] tokens = line.split(" ");

System.out.println(tokens.length-1);

.......

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

Write a program in Lex to eliminate white space and collect numbers as a token?

write a lex program to delete space from the program


What was the first program to send Americans to space?

Mercury was the name given to the first American space program.


How do you give space in HTML?

Space can be given by a special command.   gives a tabular space in program.


What does Greek mythology have to do with space?

The Greeks god of the sun was Apollo and that was the name given to the US space program that landed men on the moon.


What was the name given to the space program using three astronauts on each flight?

It was called the Apollo mission.


What does a short line in front of the word program mean---- program?

blank program


Should i capitalize Space Program?

Yes, "Space Program" should be capitalized when referring to the official name of a specific space program, such as NASA's Space Program.


What is the space program?

A program by JFK to get The Americans to space or to the moon!


When did the space program end?

The space program has not ended


What was the name of the space program to send two men into space?

Soviet Space Program


The American space program that carried teams of mostly three astronauts into space?

The space program was Project Apollo, or the Apollo Program.


How do you write a code that will count the number of white spaces in c?

Given a null-terminated string, scan through the string one character at a time until you reach the null-terminator. Each time you encounter a space character (ASCII code 32 decimal or 0x20 hexadecimal) increment a zero-initialised counter. int count_spaces (char* str) { int count=0; char ch; while (ch=*str++) if (ch==0x20) ++count; return count; }