【发布时间】:2014-01-31 19:37:48
【问题描述】:
所以万一有人偶然发现同样的问题,我有一个字符串:
a = " I am a string with whitespace at the start and end "
有趣的是,当尝试a.strip 时,我的字符串没有更改为:
a = "I am a string with whitespace at the start and end"
【问题讨论】:
-
squish和.squeeze(' ')再次遇到同样的问题。我的回答在这些情况下也适用。
标签: ruby-on-rails strip gsub