如何从原始字符串中搜索子字符串

时间:2012-05-05 18:46:39

标签: android

String ORIGINAL = "This is my demo string";
String search = "demo";

如果“demo”退出到ORIGINAL然后结果为true,我想将结果显示为true或false,否则返回false

1 个答案:

答案 0 :(得分:1)

if(ORIGINAL.contains(search))
     //found
else
    //not found