English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

String str = "This is a string";


How do I go about counting the whitespace that occurs in that string?
Thanks!

2006-10-25 12:18:18 · 3 answers · asked by javaHungerForce 3 in Computers & Internet Programming & Design

3 answers

int numSpaces =
new StringTokenizer (theString, " ").countTokens()-1;

2006-10-25 15:10:13 · answer #1 · answered by n0body 4 · 0 0

John Singleton's best film also proved to be one of my favorite movies about life in the streets. Cuba Gooding, Jr. displayed early on he was going to be a respectable actor. The power of the film has yet to be matched as most modern interpretations of street life prove to be violent stylizations. While Singleton has taken a couple missteps along the way, this film still stands up rather well by today's standards. The motives and actions appear realistic, especially Doughboy's thirst for revenge. A good film, which not only helped improve Laurence Fishburne's career, but introduced us to Gooding.

2006-10-25 13:02:26 · answer #2 · answered by Anonymous · 0 0

convert the String data type to a c-string data type, then you can compare any character(s) you want!

2006-10-25 12:35:59 · answer #3 · answered by D 4 · 0 0

fedest.com, questions and answers