I know this question has been asked to
death but I have tried all solutions that were given to href="https://stackoverflow.com/questions/658953/if-statement-with-string-comparison-fails">this
question and my if statement still doesn't execute..
My code goes
like this:
String s =
"Something*like*this*";
String[] sarray =
s.split("\\*");
for(int i = 0; i < sarray.length; i++)
{
if(sarray[i].equals("this")) {
//do something
}
}
Any
suggestions would be greatly appreciated.
No comments:
Post a Comment