I have the following: ifexOf Ral 1 What I like to do is to make Ral case insensitive, rAl, still match., etc , so that it can be RAl
29 Oct 2017 indexOf , the stringcheddar" is not found., case sensitivity The following example defines two string variables The variables contain the same string except that the second string contains uppercase letters The first console log method displays 19 But because the indexOf method is case sensitive
12 Jul 2014 Easy way would be to have a temporary array that contains all the names in uppercase Then you can compare the user input So your code could become somthing like this: function delName var dnameVal document getElementById 39 delname 39 value; var upperCaseNames.
You can use regex with a case insensitive modifier admittedly not necessarily as fast as indexOf var noPic arch nopic i.
Definition and Usage The indexOf method returns the position of the first occurrence of a specified value in a string This method returns1 if the value to search for never te: The indexOf method is case sensitive Tip: Also look at the lastIndexOf method. Add toLowerCase after referrer This method turns the string in a lower case string Then, exOf using ral instead of Ral ifreferrer toLowerCase indexOf ral 1 The same can also be achieved using a Regular Expressionespecially useful when you want to test against dynamic.