method
ascii_only?
v2_4_6 -
Show latest stable
- Class:
String
ascii_only?()public
Returns true for a string which has only ASCII characters.
"abc".force_encoding("UTF-8").ascii_only? #=> true "abc\u{6666}".force_encoding("UTF-8").ascii_only? #=> false