| Author |
length....seems simple...but it isnt working
|
amr amr
Greenhorn
Joined: Mar 27, 2004
Posts: 6
|
|
I have a string that can be like I want to count the number of ones in the string...which should be 6 according to this example...but the length() functino doesnt seem to be returning the right value...helpp!!
|
 |
Dirk Schreckmann
Sheriff
Joined: Dec 10, 2001
Posts: 7023
|
|
What value seems to be returned by b.length()? How is it that you are using/displaying this value? When I run your code, with a System.out.println(len); immediately after it, I get 6, as expected. [ April 09, 2004: Message edited by: Dirk Schreckmann ]
|
[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
|
 |
 |
|
|
subject: length....seems simple...but it isnt working
|
|
|