I know this question has been asked to death but I have tried all solutions that were given to 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.