切割字符串錯誤:Unclosed character class near index 0 [ ^ 轉義符問題

 Exception in thread "main" java.util.regex.PatternSyntaxException: Unclosed character class near index 0 [ ^ 出現此錯誤應該是字符轉義出現問題:java System.out.println(str.replaceAll("[", "22")); 解決方案:在[以前加上\\ Syste
相關文章
相關標籤/搜索