0
how to solve the javascript case sensitive problem ?
Javascript case sensitive problem like if i put "I am fine" as a user then i just put "fine" in my bot it says error in the user
13 Réponses
+ 8
That is unexpected behavior. Imma gonna have to do some experimentations on this. 😉
Thanks for sharing.
+ 7
Can confirm; I am also getting "1" as the output rather than "true".
Even if I do "console.log(Boolean(1))", it still gives "1" and not "true".
Edit:
console.log(1==true); // 1
console.log(1===true); // 0
console.log(Boolean(1)===true) // 1
+ 6
Code Crasher Those output as boolean "true" values on my Android.
Are you getting integer 1 as the output from iOS?
+ 5
var f = "I'm fine".includes('fine');
console.log(f); // true
f = "fine".includes('fine');
console.log(f); // true
f = "I'm not fine".includes('fine');
console.log(f); // true
+ 2
Before passing the text input to evaluation by the bot, first do a case change, i.e, to lower case or upper case depending on what case the bot requires. If it needs uppercase input, then
let input = uInput.toUpperCase();
Or if its lower case needed then
let input = uInput.toLowerCase();
Happy coding ☺ Keep coding 🙏🏾
+ 2
thanks for your answer code crasher
+ 2
i think regex with i flag is also an alternative for you (if you know)
+ 1
how about search sensitive?
+ 1
Ellaborate further please
+ 1
if user said i am a friend of yours even if i put friend at the user input it still says i dont understand...
+ 1
thanks to the two of you