Given a string, parse it as a boolean value using the following rules:
Truthy strings: "true", "True", "TRUE", "1", "yes", "Yes", "YES"
Falsy strings: "false", "False", "FALSE", "0", "no", "No", "NO"
Anything else (including empty string): return false.
The matching should be exact — no trimming of whitespace, no partial matches.
s = "true"trues = "YES"trues = "maybe"false0 <= s.length <= 50s consists of printable ASCII characters.Run your code to see results
Use Cmd+Enter to run