문제

How to detect in Ruby if a sentence has all lower case letters? Likewise, how to detect if a sentence has all uppercase letters?

You can assume this is an English sentence with no foreign characters.

Simple question, I know. Please excuse brevity.

올바른 솔루션이 없습니다

다른 팁

'string' == 'string'.downcase

If the string is equal to the string with all letters lowercased, then all letters are lowercased.

See here and here.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top