Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/certstepper.rb

Instance Method Summary collapse

Instance Method Details

#strip_control_and_extended_charactersObject



16
17
18
19
20
# File 'lib/certstepper.rb', line 16

def strip_control_and_extended_characters()
  chars.each_with_object("") do |char, str|
    str << char if char.ascii_only? and char.ord.between?(32,126)
  end
end

#strip_control_charactersObject



10
11
12
13
14
# File 'lib/certstepper.rb', line 10

def strip_control_characters()
  chars.each_with_object("") do |char, str|
    str << char unless char.ascii_only? and (char.ord < 32 or char.ord == 127)
  end
end