Regular expression. Translation of lines.



  • Hi. Textarea introduces poems. How do we identify the entry numbers of all wire transfers on Javascript?



  • var txt = document.getElementById('txtarea').value.replace('\r', '');
    var txtar = txt.split('\n');
    //а далее - работаем с txtar[i].length
    

    IE7 (thanks AlexWindHope):

    var txt = document.getElementById('txtarea').value.replace('\r', '');
    

    var txtar = txt.split('\n');
    //а далее - работаем с (txtar[i].indexOf('\r') ? txtar[i].length-1 : txtar[i].length)




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2