When we are coping some source codes from web pages, also coping with line numbers.If we are coping large source code can you remove there line numbers manually.It is not practical and wasting your time.Here is the best and easy way to remove line number from a source code using javascript.
Following simple javascript function is removing line numbers.
var re = new RegExp("^\\s*\\d+\\.?", "gm"); function removeLineNumbers(textArea) { textArea.value = textArea.value.replace(re, ""); }
Call to this function as follows.
Here is a demo you can online remove line numbers from your any type of large source codes.
Online Removing line numbers from source codes Demo