Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有以下字符串,我想在那里检测换行符。但是 Ruby 的 string 方法include?无法检测到它。
include?
我正在跑步Ruby 1.9.2p290。我哪里错了?
Ruby 1.9.2p290
"/'ædres/ \nYour ".include?('\n') => false
\n需要在双引号字符串中,否则不会转义。
\n
>> "\n".include? '\n' => false >> "\n".include? "\n" => true