java - Getting ArrayIndexOutOfBound on String split -


i splitting string in string array.

string = "somestring1, somestring2 00000-0000";     string[] b = a.split("(\\, )|(\\ )|(\\-)");     

and assigning array values

string c = b[0];     string d = b[1];    string e = b[2];    string f = b[3];     

which giving exception arrayindexoutofbound array index out of range: 4


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - How can I echo out this array? -

javascript - IE11 incompatibility with jQuery's 'readonly'? -