String str ="|m4oho5kspqikkfn2may72osnfzmn3gutwzqctblzqy6rygwzxbra6bjkmy|113|70|";
String[] tokens = str.split("|");
System.out.println(tokens[0]);
System.out.println(tokens[1]);
结果为白色:: 0
我只需要这个 但我唯一想回来的是:m4oho5kspqikkfn2may72osnfzmn3gutwzqctblzqy6rygwzxbra6bjkmy
抱歉,英语不太好,我正在使用谷歌翻译
最佳答案
|
是正则表达式保护的字符。分割时需要转义它,如下所示:
str.split("\\|");
问候
关于java - split 函数不返回,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35225544/