Home All Groups Group Topic Archive Search About

Utility to remove comments in vb.net files

Author
19 Dec 2006 7:59 PM
neelu
I need a utility to remove all the comments from vb.net files

Thanks in advance

Author
19 Dec 2006 8:02 PM
lord.zoltar
neelu wrote:
> I need a utility to remove all the comments from vb.net files
>
> Thanks in advance

write a VB.NET program to do it?
should be easy: any line with a single quote as the first character
should be removed. and everything AFTER a single quote (even if it's
not the first character), provided the quote is not between a pair of
double quotes.
and the files you send to this program are any *.vb files.
Author
19 Dec 2006 8:14 PM
IdleBrain
Why don't you just do a SEARCH & REPLACE for ' with a space?
Author
19 Dec 2006 8:49 PM
lord.zoltar
IdleBrain wrote:
> Why don't you just do a SEARCH & REPLACE for ' with a space?

;)
mmmm... yeah search and replace with a regular expression would
probably be quickest... I thought this guy really wanted a program that
did, uh, search and replace. oh well.
Author
20 Dec 2006 1:51 AM
Herfried K. Wagner [MVP]
"IdleBrain" <indianmostwan***@yahoo.com> schrieb:
> Why don't you just do a SEARCH & REPLACE for ' with a space?

Because it's not always that easy:

\\\
Bla("Frank's book")
Foo()    ' This and that. '
///

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://dotnet.mvps.org/dotnet/faqs/>