Ask coding questions

← Back to all posts
How can I make the user input case insensitive
karlylamm1 (3)

I am trying to make my user input quiz case insensitive so that if you reply "true" or "True," it will still count as correct.

Thanks!
[Repl link removed due to profanity]

Answered by Coder100 (1295) [earned 5 cycles]
View Answer
Commentshotnewtop
Coder100 (1295)
string.toLowerCase()

docs
In this case, on line 28

  inputUserArray.push(userInput.toLowerCase());

Please mark as correct answer if it has helped you!

AllAwesome497 (330)

again, please keep profanity out of posts, even if it's in links.

karlylamm1 (3)

No profanity intended. It was short for my assignment 1. my apologies @AllAwesome497

AllAwesome497 (330)

@karlylamm1 ok. Please change the name anyways, ur setting off my bots auto reporting.