module UnicodeTools

Constants

BIDI_OVERRIDE_CHARACTERS_REGEXP
LEADING_WHITESPACE_REGEXP
SURROUNDING_WHITESPACE_REGEXP
TRAILING_WHITESPACE_REGEXP
WHITESPACE_CHARS

unicode.org/charts/uca/

WHITESPACE_REGEXP

Public Class Methods

has_bidi_override?(string) click to toggle source
# File lib/unicode-tools/bidi.rb, line 8
def has_bidi_override?(string)
  !!(string =~ BIDI_OVERRIDE_CHARACTERS_REGEXP)
end
has_whitespace?(string) click to toggle source
# File lib/unicode-tools/whitespace.rb, line 16
def has_whitespace?(string)
  string.has_whitespace?
end
replace_whitespace(string, replacement = nil, &block) click to toggle source
# File lib/unicode-tools/whitespace.rb, line 36
def replace_whitespace(string, replacement = nil, &block)
  string.replace_whitespace(replacement, &block)
end
replace_whitespace!(string, replacement = nil, &block) click to toggle source
# File lib/unicode-tools/whitespace.rb, line 40
def replace_whitespace!(string, replacement = nil, &block)
  string.replace_whitespace!(replacement, &block)
end
squish(string) click to toggle source
# File lib/unicode-tools/whitespace.rb, line 28
def squish(string)
  string.squish
end
squish!(string) click to toggle source
# File lib/unicode-tools/whitespace.rb, line 32
def squish!(string)
  string.squish!
end
strip_bidi_override_characters(string) click to toggle source
# File lib/unicode-tools/bidi.rb, line 12
def strip_bidi_override_characters(string)
  string.gsub(BIDI_OVERRIDE_CHARACTERS_REGEXP, '')
end
strip_bidi_override_characters!(string) click to toggle source
# File lib/unicode-tools/bidi.rb, line 16
def strip_bidi_override_characters!(string)
  string.gsub!(BIDI_OVERRIDE_CHARACTERS_REGEXP, '')
end
trim(string) click to toggle source
# File lib/unicode-tools/whitespace.rb, line 20
def trim(string)
  string.trim
end
trim!(string) click to toggle source
# File lib/unicode-tools/whitespace.rb, line 24
def trim!(string)
  string.trim!
end