我有一个字符串,说从字符串中提取的字符只,并将其存储在另一个字符串
String str = "1.) Java is fun. play with 12"
我想要的一切后)
存储作为单独的字符串。什么是最好的方式来做到这一点?我试着劈裂串上")"
:
String det[] = str.split(")");
但它给:
java.util.regex.PatternSyntaxException:无与伦比的闭幕 ')'`
样品输入:
String str = "1.) JAVA is fun.Play with 12"
取样输出:
String result = "JAVA is fun.Play with 12"
String det [] = str.split(“)”); – user3681970