这非常简单:我如何去除特殊字符的红宝石字符串?这里的字符: http://www.fileformat.info/info/unicode/char/2028/index.htm特定控制字符的地带红宝石字符串
而这里的字符串,与周期之间以及两个特殊字符结尾报价:和
string.gsub!(/[\x00-\x1F\x7F]/, '')
:
"Each of the levels requires logic, skill, and brute force to crush the enemy.
"
我失败尝试这样做使用ruby 1.9.3p125
GSUB( “/ \ n /”, “”)更一般的,效率较低,在此? – Ascherer 2012-04-05 00:04:47
@Ascherer不工作:( – nnyby 2012-04-05 00:05:49
\ x1F^_(单元分隔符,信息分隔符之一)......去这里http://donsnotes.com/tech/charsets/ascii.html – zee 2016-01-25 05:04:44