Comparing two strings that are "Random" and "RandoM", would result in a true case. What I want to do is to check also for the lower and upper cases (case-sensitive) and return false in this example. Right now, what I have is
userText = userText + e.target.value;
if (userText[userText.length-1] != typeracertext[userText.length-1])
{
e.target.value = e.target.value.substring(0, e.target.value.length-1);
return;
}
and it return true when there is difference in the lower-upper cases. Any ideas?
EDIT: Found a solution, so for anyone that is struggling to find one, here is your solution:
str1.localeCompare(str2) =
//returns 0 if true
//return -1 if str2 is stronger
//returns 1 if str1 is stronger