1234567891011121314 |
- var getstr = function (val) {
- if (val.length == 0 || val == undefined) {
- return;
- }
- if (val.length > 10) {
- // return (val.substring(0, 10) +" "+ val.substring(11, 19));
- return (val.substring(0, 10));
- }
- else {
- return val;
- }
- }
- //exports: 通过该属性,对外共享本模块的私有变量与函数。
- module.exports.getstr = getstr;
|