Last active
December 15, 2015 04:26
-
-
Save zzbo/9ce34f5634d348d8cbb7 to your computer and use it in GitHub Desktop.
简易dos文件格式转unix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//简易dos文件格式转unix | |
module.exports = function(str){ | |
return str.replace(/(?:\r(\n)|\^M$|\x0D$)/g, '$1'); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment