Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/360.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/204.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Android拆分字符串或使用matcher更改字符串_Java_Android_Regex - Fatal编程技术网

Java Android拆分字符串或使用matcher更改字符串

Java Android拆分字符串或使用matcher更改字符串,java,android,regex,Java,Android,Regex,我正在把这根绳子劈开 String xml_getMembermob = "Art C. Cauyao<$@PERX@$>501912568<$@ENDPERX@$>Tessa Rose Brainard<$@PERX@$>510831686<$@ENDPERX@$>" 我听到日志上说的 09-10 10:53:44.878: I/returned string get(1198): <$@ENDPERX@$> 所以我可以得出结论,

我正在把这根绳子劈开

String xml_getMembermob = "Art C. Cauyao<$@PERX@$>501912568<$@ENDPERX@$>Tessa Rose Brainard<$@PERX@$>510831686<$@ENDPERX@$>"
我听到日志上说的

09-10 10:53:44.878: I/returned string get(1198): <$@ENDPERX@$>
所以我可以得出结论,上面的代码是有效的


您能帮我拆分这个字符串或更改它的一些单词,以便我可以轻松拆分它吗?

要在文本中找到模式并替换它,请使用以下命令:

Pattern p = Pattern.compile("find and replace me!");
Matcher m = p.matcher("a very long string that contains zero or more find and replace me! pattern inside");
StringBuffer sb = new StringBuffer();
boolean result = m.find();
while(result) {
    m.appendReplacement(sb, "I found you!");
    result = m.find();
}
m.appendTail(sb);
String strWithLink = sb.toString();
此代码将在您的字符串中搜索并替换所有“查找并替换我”!我找到你了

09-10 10:53:44.878: I/returned string get(1198): <$@ENDPERX@$>
Pattern p = Pattern.compile("find and replace me!");
Matcher m = p.matcher("a very long string that contains zero or more find and replace me! pattern inside");
StringBuffer sb = new StringBuffer();
boolean result = m.find();
while(result) {
    m.appendReplacement(sb, "I found you!");
    result = m.find();
}
m.appendTail(sb);
String strWithLink = sb.toString();