在数据中使用"|"分隔符,在解析的时候,使用split("|"),得到的结果和预期不一致,是因为|在正则表达式中有含义,需要使用转义符来表示
比如数据是 str= "red|yellow|black";
String[] str_sp = ("\\|")
在数据中使用"|"分隔符,在解析的时候,使用split("|"),得到的结果和预期不一致,是因为|在正则表达式中有含义,需要使用转义符来表示
比如数据是 str= "red|yellow|black";
String[] str_sp = ("\\|")