Skip to content

Instantly share code, notes, and snippets.

@chensoren
Created November 29, 2015 14:28
Show Gist options
  • Save chensoren/eb0cef90db3733bf6bc4 to your computer and use it in GitHub Desktop.
Save chensoren/eb0cef90db3733bf6bc4 to your computer and use it in GitHub Desktop.

Revisions

  1. chensoren revised this gist Nov 29, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion newline_textarea.rb
    Original file line number Diff line number Diff line change
    @@ -2,4 +2,4 @@
    test_string <<EOF
    Specifications:\n Brand: Brand new and high quality\n Style: Sexy black lace mask\n\nItem Description\n 1. Suit for all kinds of occasion like party and Halloween.\n 2. Matching your clothes well.\n\nPackage Includes\n1 x Masquerade Mask
    EOF
    test_string = gsub(/(\\r\\n)|\\n/, "\n")
    test_string.gsub(/(\\r\\n)|\\n/, "\n")
  2. chensoren created this gist Nov 29, 2015.
    5 changes: 5 additions & 0 deletions newline_textarea.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    #need replace with double quote instead of single quote
    test_string <<EOF
    Specifications:\n Brand: Brand new and high quality\n Style: Sexy black lace mask\n\nItem Description\n 1. Suit for all kinds of occasion like party and Halloween.\n 2. Matching your clothes well.\n\nPackage Includes\n1 x Masquerade Mask
    EOF
    test_string = gsub(/(\\r\\n)|\\n/, "\n")