The Artima Developer Community
Sponsored Link

Java Answers Forum
help with getting the first 10 values from a string

2 replies on 1 page. Most recent reply: Jan 14, 2003 11:19 AM by Matt Gerrans

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
ben

Posts: 57
Nickname: loftty
Registered: Oct, 2002

help with getting the first 10 values from a string Posted: Jan 14, 2003 4:40 AM
Reply to this message Reply
Advertisement
Hello again
I have a string with 30 strings inside it.
how can i get the first 10 values out use them in a part of my code. then get the next 10 values out and use them in a diffrent part of my code, and so on with the last 10 values? also i have blank strings inside the string so i cannot use the substring method as it does not allow blank strings.
could someone please help me
thanks ben


Antonas

Posts: 11
Nickname: tony
Registered: May, 2002

Re: help with getting the first 10 values from a string Posted: Jan 14, 2003 8:56 AM
Reply to this message Reply
What You mean string with 30 strings in it ?

Matt Gerrans

Posts: 1153
Nickname: matt
Registered: Feb, 2002

Re: help with getting the first 10 values from a string Posted: Jan 14, 2003 11:19 AM
Reply to this message Reply
If the values are separated by some delimiter (such as comma or space) you can use StringTokenizer. If they are at fixed positions, then String.substring() is sufficient.

Flat View: This topic has 2 replies on 1 page
Topic: Error in accessing the javax package Previous Topic   Next Topic Topic: A 13 year old programmer from india kerala

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use