mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-20 18:18:56 +00:00
refactor(client) getStrBigFirst
This commit is contained in:
parent
2021c85989
commit
58e973c0dd
1 changed files with 7 additions and 5 deletions
|
|
@ -464,13 +464,15 @@ var Util, DOM, CloudFunc, join;
|
|||
};
|
||||
|
||||
function getStrBigFirst(str) {
|
||||
var isStr = Util.type.string(str),
|
||||
ret = str;
|
||||
var first;
|
||||
|
||||
if (isStr && str.length)
|
||||
ret = str[0].toUpperCase() + str.substring(1);
|
||||
if (!str)
|
||||
throw Error('str could not be empty!');
|
||||
|
||||
return ret;
|
||||
first = str[0].toUpperCase();
|
||||
str = first + str.slice(1);
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue