Friday, June 8, 2012

Replace row numbers from copied code

This has nothing to do with SharePoint but I wanted to share the trick. When you copy code from some pages sometimes you have to copy the ugly row numbers, like

1: function XYZ
3:     var a = b;

You can delete these numbers easily with NotePad++ or another higher TextEditor. I use NotePad++ so I'll show you have I do that with NP.

  1. Copy the code into the editor
  2. Open the "Replace" dialog
  3. Check "Regular Expression"
  4. Enter the regular expression in "Find What" = \d*: (This can be any other regex)
  5. Enter nothing into "Replace String"

No comments: