Method: UnicodeUtils.white_space_char?

Defined in:
lib/unicode_utils/white_space_char_q.rb

.white_space_char?(char) ⇒ Boolean

True if the given character has the Unicode property White_Space.

Example:

require "unicode_utils/general_category"
require "unicode_utils/white_space_char_q"

UnicodeUtils.general_category("\n")   => :Control
UnicodeUtils.white_space_char?("\n")  => true

Returns:

  • (Boolean)
[View source]

18
19
20
# File 'lib/unicode_utils/white_space_char_q.rb', line 18

def white_space_char?(char)
  WHITE_SPACE_SET.include?(char.ord)
end