兼容 以- 或者 | 分割的数据.
private String[] splitTids(String tp_tid) {
return tp_tid.split("[-\\|]");
}
public static void main(String[] args) {
ProcessNotifyImpl n = new ProcessNotifyImpl();
String[] str = n.splitTids("[线下]XD14091800003|1871279782");
for(String s:str){
System.out.println(s);
}
}
本文介绍了一个处理包含使用'-'和'|'作为分隔符的数据字符串的Java方法,通过实例演示了如何使用split函数进行字符串分割。
746

被折叠的 条评论
为什么被折叠?



