Ruby - String Operations
Given a user input string that may have spaces and mixed case, which Ruby code snippet safely normalizes it to lowercase without extra spaces?
strip to remove spaces from start and end before changing case.downcase after stripping to get lowercase string without spaces.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions