-1
我輸入字符串如下:根據java中的典型條件拆分字符串?
String sample1 = "productName/@languageCode";
String sample1="brandNameInformation/languageSpecificBrandName/@languageCode";
我想只有當存在「/」 occurence分割它,而不是當「/ @」
我該怎麼辦呢? 任何人都可以幫忙嗎?
'的String [] =零件sample1.split( 「/ [^ @]」);' –
看一看[點擊這裏](https://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html)並搜索「lookahead」。 – Mena