In today's project, I encountered "." , "\", "|" to separate the string, directly using ".", "\", "|" can not be divided, because ".", "\", "|" are Special characters need to be escaped, "\\.", "\\", "\\|".
1 String goodsStr="100: said: test 1|10: yes: test 2" ; 2 String[] goodList = goodsStr.split("|");
after escaping
String goodsStr="100: Said: Test 1|10: Yes: Test 2" ;
String[] goodList = goodsStr.split("\\|");