-
白猪掌柜的
Java版
String str = "a|bb||cc";
String[] arr = str.split("(?<=[^\\|])\\|(?!\\|)");
System.out.println(Arrays.toString(arr));
-
FFIVE
preg_split('/(?<!\|)\|(?!\|)/', "A|bbbbb||CCCCC");
-
富国沪深
"A|bbbbb||CCCCC"
.replace(/\|\|/g, "=end=")
.split("|")
.map((it)=>it.replace(/=end=/g, '||'));
-
宝慕林4294392
$str = 'A|bbbbb||CCCCC';
list($part_one, $part_two) = explode('|', $str, 2);
-
哔哔one
String str="A|bbbbb||CCCCC";
String[] arr=str.split("\\|", 2);
-
慕工程0101907
难道不是
$str = 'A|bbbbb||CCCCC';
$str=str_replace('||','|’,$content);
-
犯罪嫌疑人X
var str = "AAA|fccc||ddddd";
console.log("-------------");
var re =new RegExp('([^\\|]*)\\|(.*)');
var array = str.match(re);
console.log("-------------");
console.log(array);