<

![endif]-->

fc2ブログ

タブスライサー

空白トリム


ソース
function execSepBtn_click(){
  outDat.value = dat ='';
  var ket = sepLen.value.split(/[\t,\r\n]/);
  var nyu = inpDat.value.replace(/\r\n/g,"\n").replace(/\r/g,"\n").split("\n");

  for(var k in nyu){
    var st=0;
    if((k == nyu.length-1)&&(nyu[k] =="")) break;
    for(var i in ket){
      var en = st + Number(ket[i]);
      for(j=st; j<en; j++){
        var c = nyu[k].charCodeAt(j);
        if(0x80 <= c && (c <= 0xff60 || 0xffa0 <= c)) en --;
      }
      dat += cutBlank.checked ?
               (nyu[k].slice(st,en).replace(/^\s*|\s*$/g,'')+"	") : 
               (nyu[k].slice(st,en)+"	");
      st = en;
    }
    dat = dat.replace(/\t$/,"")+"\r\n";
  }
  outDat.value = dat;
  outDat.select();
  $(outDat).toggle().fadeIn();
}



comment

Secret

while(aho.atEndofStream)

笹部 政宏
笹部 政宏
mail




フリーソフツ
Category
はてブ
Monthly Archive
New Entry
New Comment
New Trackback
RSS
Copyright © Kittens flewby me All Rights Reserved.