I have a java string delimited by |-| like below.
我有一个由| - |分隔的java字符串如下。
Can't find |-| deliter based split any where else this is unique.
找不到| - |基于deliter的分裂任何其他地方都是唯一的。
String agent = "iOS|-|iPhone|-|18.2.3|-|kuoipo-kjpopoo-kijhloii-kllkijii";
What is the correct regex to split the contents in string Array like below.
如下所示,在字符串数组中拆分内容的正确正则表达式是什么。
String[] dataarray;
dataarray[0]="iOS";
dataarray[1]="iPhone";
dataarray[2]="18.2.3";
dataarray[3]="kuoipo-kjpopoo-kijhloii-kllkijii";
Already tried:
agent.split("\\|-\\|");
Thanks in Advance.
提前致谢。
1 个解决方案
#1
3
Won't work
agent.split("|-|")
Do
agent.split("\\|-\\|")
#1
3
Won't work
agent.split("|-|")
Do
agent.split("\\|-\\|")