d = "foo\u00A0\bar"
当我检查长度,它说,它是7个字符长.我在线检查,发现这是一个不间断的空间.有人会告诉我如何删除字符串中的所有不间断的空格?
irb(main):001:0> d = "foo\u00A0\bar" => "foo\bar" irb(main):002:0> d.gsub("\u00A0","") => "foo\bar"