Count non-whitespace characters for selection in Visual Studio 2010 -


does know of tool or extension visual studio 2010 count non-whitespace (e.g. characters not spaces, new lines etc.) current selection in document?

nice have code golfing :)

i have command line tool, integrated tool nice. prefer evaluate current selection.

i got creating crude macro below first recording temporary macro in visual studio , modifying below:

option strict off option explicit off imports system imports envdte imports envdte80 imports envdte90 imports envdte90a imports envdte100 imports system.diagnostics  public module countnonwhitespacecharacters     sub count()         dim selection envdte.textselection = dte.activedocument.selection()         dim text string = selection.text          text = text.replace(" ", "")         text = text.replace(vbcrlf, "")         text = text.replace(vbtab, "")          msgbox("count " + text.length.tostring())     end sub     end module 

this can bound keybord shortcut if desired. otherwise, double clicking in macro explorer run it.


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -