mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-21 02:29:23 +00:00
feature(util) rmNewLine: add "\r"
This commit is contained in:
parent
50142b6a48
commit
8d2e0548e9
1 changed files with 3 additions and 2 deletions
|
|
@ -65,9 +65,10 @@ Util = exports || {};
|
|||
* @param {string} pText
|
||||
*/
|
||||
Util.rmNewLine = function(pText){
|
||||
var n = pText && pText.length - 1;
|
||||
var n = pText && pText.length - 1,
|
||||
char = pText[n];
|
||||
|
||||
if (n && pText[n] == '\n')
|
||||
if (n && char === '\n' || char === '\r')
|
||||
pText = pText.substr(pText, n);
|
||||
|
||||
return pText;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue