-4
String ORIGINAL = "This is my demo string";
String search = "demo";
我想要得到的结果为真或假,如果“演示”是退出原始则结果为true,否则返回false如何搜索子字符串从原来的字符串
String ORIGINAL = "This is my demo string";
String search = "demo";
我想要得到的结果为真或假,如果“演示”是退出原始则结果为true,否则返回false如何搜索子字符串从原来的字符串
if(ORIGINAL.contains(search))
//found
else
//not found
使用'contains' ? 'indexOf'?你甚至看过字符串API吗? –