I am facing a very basic problem. Some time small things can take your whole day :( but thank to stackoverflow memebers who always try to help :)
I am trying to match 2 strings if they match it should return TRUE
now I am using this
if (var1.indexOf(var2) >= 0) {
return true;
}
But if var1 has value "maintain" and var2 has value "inta" or "ain" etc. it still return true :(. Is there any way in java that can do full text matching not partial? For example
if("mango"=="mango"){
return true;
}
thanks ! ! !
Why not just use the built-in String equals() method?
return var1.equals(var2);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With