Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/string-utf8mb4strip.rb

Instance Method Summary collapse

Instance Method Details

#utf8mb4stripObject



2
3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/string-utf8mb4strip.rb', line 2

def utf8mb4strip
  newstr = ""
  
  self.each_char do |char|
    byte = char.bytes.first
    
    if byte < 240
      newstr << char
    end
  end
  
  return newstr
end