Skip to content
instance method

String#ascii_only?

() -> bool
ascii_only? → true or false

Returns whether self contains only ASCII characters:

Example
'abc'.ascii_only?         # => true
"abc\u{6666}".ascii_only? # => false

Related: see Querying.

See also #append_as_bytes #b #[]= #byteindex also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0