Class: String

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

Instance Method Summary collapse

Instance Method Details

#strip_control_and_extended_charactersObject



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

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



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

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