public String getString(String s, String s1)//s是需要删除某个子串的字符串s1是需要删除的子串
{
int postion = s.indexOf(s1);
int length = s1.length();
int Length = s.length();
String newString = s.substring(0,postion) + s.substring(postion + length, Length);
return newString;//返回已经删除好的字符串
}
安卓从字符串中删除指定的子串
最新推荐文章于 2024-04-19 13:44:22 发布