Javascript中字符串和数字的操作方法整理

https://www.jb51.net/article/103969.htm

    getNameXing(vName){
      let lOld = "";
      let l1 = "" ;
      let l2 = "" ;
      let l3 = "" ;
      let lResult = "";

      lOld = vName;
      l1 = vName.substring(0,2).toString();
      l2 = vName.substring(1,2).toString();

      l3 = l1.replace(l2,'*');

      lResult = lOld.replace(l1,l3);
      return lResult;
    },
posted @ 2022-08-01 11:02  寒冷的雨呢  阅读(41)  评论(0编辑  收藏  举报