mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-19 09:24:51 +00:00
feature(cloudfunc) rm: addNewLine, rmNewLine
This commit is contained in:
parent
548bb8d7f1
commit
cb4f2e1b41
1 changed files with 0 additions and 25 deletions
|
|
@ -32,31 +32,6 @@ var Util;
|
|||
this.CHANNEL_TERMINAL_RESIZE= 'terminal-resize';
|
||||
this.MAX_FILE_SIZE = 500 * 1024;
|
||||
|
||||
/**
|
||||
* ad new line (if it's not)
|
||||
* @param {string} pText
|
||||
*/
|
||||
this.addNewLine = function(text) {
|
||||
var newLine = '',
|
||||
n = text && text.length;
|
||||
|
||||
if(n && text[n-1] !== '\n')
|
||||
newLine = '\n';
|
||||
|
||||
return text + newLine;
|
||||
};
|
||||
|
||||
/**
|
||||
* rm new line (if it's)
|
||||
* @param {string} pText
|
||||
*/
|
||||
this.rmNewLine = function(text) {
|
||||
var strs = ['\n', '\r'],
|
||||
str = Util.rmStr(text, strs);
|
||||
|
||||
return str;
|
||||
};
|
||||
|
||||
this.getStrBigFirst = function(str) {
|
||||
var isStr = Util.type.string(str),
|
||||
ret = str;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue