LoginSignup
1
0

More than 5 years have passed since last update.

改行の統一

Posted at
irb(main):001:0> "\r\n\n".gsub(/\r\n/, "\n")
=> "\n\n"
irb(main):002:0> "\r\n\n".gsub(/\R/, "\n")
=> "\n\n"

正規表現 (Ruby 2.5.0) https://docs.ruby-lang.org/ja/latest/doc/spec=2fregexp.html

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0