I have a stringbuilder which length is not fixed. I have to search a string like "ff d9" into this stingbuilder/ If the stringbuilder contains this sting i can print yes otherwise print not.
1 Answer
Try this way,hope this will help you to solve your problem.
StringBuilder stringBuilder = new StringBuilder("test test test ff d9 test test test");
if(stringBuilder.indexOf("ff d9")<=0){
Toast.makeText(context,"No",Toast.LENGTH_SHORT).show();
}else{
Toast.makeText(context,"Yes",Toast.LENGTH_SHORT).show();
}