java - split function doesn't return -


string str ="|m4oho5kspqikkfn2may72osnfzmn3gutwzqctblzqy6rygwzxbra6bjkmy|113|70|"; string[] tokens = str.split("|");  system.out.println(tokens[0]); system.out.println(tokens[1]); 

result in white:: 0

i need thing want come is: m4oho5kspqikkfn2may72osnfzmn3gutwzqctblzqy6rygwzxbra6bjkmy

sorry not english using google translator

| regex protected character. need escape when splitting so:

str.split("\\|"); 

regards


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -