sub.wxs 363 B

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