Actions
Bug #10476
closedString.strip remove characters different than pure whitespace
Description
The offical documentation (http://www.ruby-doc.org/core-2.1.4/String.html#method-i-strip) says:
strip → new_str
Returns a copy of str with leading and trailing whitespace removed.
But
[9] pry(main)> "#{0.chr}#{9.chr}#{10.chr}#{11.chr}#{12.chr}#{13.chr}#{32.chr}"
=> "\x00\t\n\v\f\r "
[10] pry(main)> "#{0.chr}#{9.chr}#{10.chr}#{11.chr}#{12.chr}#{13.chr}#{32.chr}".length
=> 7
[11] pry(main)> "#{0.chr}#{9.chr}#{10.chr}#{11.chr}#{12.chr}#{13.chr}#{32.chr}".strip
=> ""
([4] pry(main)> (0..255).each { |char| puts "char #{char} stripped" if char.chr.strip.empty? }
char 0 stripped
char 9 stripped
char 10 stripped
char 11 stripped
char 12 stripped
char 13 stripped
char 32 stripped
Stripped characters are
- Null char (0)
- Horizontal Tab (9)
- Line Feed (10)
- Vertical Tab (11)
- Form Feed (12)
- Carriage Return (13)
- Space (32)
Files
Actions
Like0
Like0Like0Like0Like0Like0Like0Like0