這非常簡單:我如何去除特殊字符的紅寶石字符串?這裏的字符: 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