• Post Reply Bookmark Topic Watch Topic
  • New Topic

Splitting array by specific value  RSS feed

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do you split an array by a specific value. For instance this is my array: "4*6*9*89" How can I take out "*" and therefore split up all the values like this: "4" "6" "9" "89"
 
lowercase baba
Bartender
Posts: 12565
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when you say "array"...do you mean the java construct, or are you simply using the term to refer to a String you have with that?

If the latter, look at the API for the String class. There is probably a method you can use to split it up.
 
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
fred rosenberger wrote:If the latter, look at the API for the String class. There is probably a method you can use to split it up.

And be aware when you find it that '*' may have a special meaning.

Winston
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!