471,328 Members | 1,900 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,328 software developers and data experts.

find and replace IDE

IDE 2003 (C#)
need to replace last string by a carriage return line feed
find themethod();
replace it by
themethod();
int i++;

thanks
Jun 27 '08 #1
5 1006
Well, I can't remember much about VS2003, but 2005/2008 support regex
for find... but:
* your "int i++;" doesn't compile...
* why not put the necessary code inside themethod()???
* if you need it outside (why?), then perhaps be pragmatic and just
put it on the same line... i.e. themethod(); i++;

But again: just put the necessary code inside themethod() - or if you
can't change themethod(), change themethod() to SomeOtherMethod()
[which you provide], and have SomeOtherMethod() do the necessary
intermediary step... the JIT will probably inline it anyways!

Marc
Jun 27 '08 #2
Also - remember that .cs is just a text file - you can use your
preferred text editing software to change it; heck, even install
VS2008 ("express" edition is free, and has "refactor" support), use
that to edit the files, and then take the .cs back to VS2003 (I'm
assuming you want to target 1.1).

As a final option; consider switching to VS2005/VS2008 and using MSBee
to target 1.1; I haven't tried it myself, but some people like it ;-p

Marc
Jun 27 '08 #3
The regex is way to go. My "Multiline Search and Replace in Visual
Studio" macro can do it for you:
http://www.helixoft.com/blog/archives/15

--
Peter Macej
Helixoft - http://www.helixoft.com
VSdocman - Commenter and generator of class documentation for C#, VB
..NET and ASP .NET code
Jun 27 '08 #4
Hello Marc:

it is just a simple sample,
and yes I have replaced on the same line. (when it can)

The replace is going to happen, adding blocks of code
"Marc Gravell" wrote:
Well, I can't remember much about VS2003, but 2005/2008 support regex
for find... but:
* your "int i++;" doesn't compile...
* why not put the necessary code inside themethod()???
* if you need it outside (why?), then perhaps be pragmatic and just
put it on the same line... i.e. themethod(); i++;

But again: just put the necessary code inside themethod() - or if you
can't change themethod(), change themethod() to SomeOtherMethod()
[which you provide], and have SomeOtherMethod() do the necessary
intermediary step... the JIT will probably inline it anyways!

Marc
Jun 27 '08 #5
thanks Peter, nice macro and all that it will help a lot, specially the
concept.

I will add that it would be nice a standalone exe for it.

Last, back to my question... can you tell me how to replace adding carriage
return line feed? I can use vs2005 IDE it is fine

"Peter Macej" wrote:
The regex is way to go. My "Multiline Search and Replace in Visual
Studio" macro can do it for you:
http://www.helixoft.com/blog/archives/15

--
Peter Macej
Helixoft - http://www.helixoft.com
VSdocman - Commenter and generator of class documentation for C#, VB
..NET and ASP .NET code
Jun 27 '08 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by hokieghal99 | last post: by
7 posts views Thread by Bart Nessux | last post: by
1 post views Thread by James Vitale | last post: by
3 posts views Thread by mouac01 | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.