紳士スタイルすべてのスペースに4

関数insertSpacesIntoString(S、DEFVAL){
  リターン S &&(関数(S){
   戻り s.length> 4 && (S
   .replace( / \ S / G '' 
   .replace( /(.{4})/g,'$1 " ))
   .replace( /(\は$ * S)/ gで、 ''  || S
  ;
 }(s.toString())) || DEFVAL || '' ;
}

 

おすすめ

転載: www.cnblogs.com/houkaihua/p/11703352.html