find and replace IDE

R

raulavi

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

thanks
 
M

Marc Gravell

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
 
M

Marc Gravell

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
 
R

raulavi

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
 
R

raulavi

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top