Skip to content

Instantly share code, notes, and snippets.

@ericchen
Created November 29, 2015 14:28
Show Gist options
  • Save ericchen/eb0cef90db3733bf6bc4 to your computer and use it in GitHub Desktop.
Save ericchen/eb0cef90db3733bf6bc4 to your computer and use it in GitHub Desktop.
在textarea里面正确显示换行
#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")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment