Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

indexof method to get spaces

807591May 11 2008 — edited May 11 2008
im using the following to get the first space
.indexOf(" ")

"how are you"

it returns 4 as it is fourth from the left.
is there a way to get the second space in this string ?

any help would be appreciated thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 8 2008
Added on May 11 2008
6 comments
970 views