-1

I have one string: "xx:yy:zz.ss" or "x:y:zz.ss"I want to cut them out of the chain:

string1: "xx"
string2: "yy"
string3: "zz"
string4: "ss"

help me

Avinash Raj
  • 172,303
  • 28
  • 230
  • 274

1 Answers1

0

Do splitting. string.split should accept regex as a parameter.

string.split("[.:]");
Avinash Raj
  • 172,303
  • 28
  • 230
  • 274
  • [Link to the documentation](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html#split(java.lang.String)) – Arc676 Dec 18 '15 at 11:19