C cdurbin Member Joined Dec 21, 2005 Messages 20 Location Kentucky Programming Experience 10+ Feb 23, 2006 #1 Anyone know how I can Replace an single string with two strings using VS2005/VB.net? Example: find: " End Sub" Replace with: " Logit()" " End Sub"
Anyone know how I can Replace an single string with two strings using VS2005/VB.net? Example: find: " End Sub" Replace with: " Logit()" " End Sub"
DavidT_macktool Well-known member Joined Oct 21, 2004 Messages 502 Location Indiana Programming Experience 3-5 Feb 23, 2006 #2 VB.NET: tempstring = tempstring.Replace(" End Sub", (" Logit()" & ControlChars.NewLine & " End Sub")) Upvote 0 Downvote
VB.NET: tempstring = tempstring.Replace(" End Sub", (" Logit()" & ControlChars.NewLine & " End Sub"))
C cdurbin Member Joined Dec 21, 2005 Messages 20 Location Kentucky Programming Experience 10+ Feb 23, 2006 #3 Reply to David Thanks David... Now I have to show my ignorance and ask, Where/how do I run that line? I am in VS2005 editing a vb.net program. Upvote 0 Downvote
Reply to David Thanks David... Now I have to show my ignorance and ask, Where/how do I run that line? I am in VS2005 editing a vb.net program.
DavidT_macktool Well-known member Joined Oct 21, 2004 Messages 502 Location Indiana Programming Experience 3-5 Feb 23, 2006 #4 Sorry, I feel stupid. That code will not work in find and replace dialog. Best bet is to replace the string once in the code and copy it. Then use find to find the end subs and ctl+v to paste the new code. I do not know of a way to do it with the replace dialog. Upvote 0 Downvote
Sorry, I feel stupid. That code will not work in find and replace dialog. Best bet is to replace the string once in the code and copy it. Then use find to find the end subs and ctl+v to paste the new code. I do not know of a way to do it with the replace dialog.
C cdurbin Member Joined Dec 21, 2005 Messages 20 Location Kentucky Programming Experience 10+ Feb 23, 2006 #5 Thanks for the effort. I should have been clearer in my post. Upvote 0 Downvote
C cdurbin Member Joined Dec 21, 2005 Messages 20 Location Kentucky Programming Experience 10+ Mar 1, 2006 #6 Solution Attached is a picture of the solution: Attachments Solution.GIF 41.8 KB · Views: 73 Upvote 0 Downvote
M m_ogden Well-known member Joined Mar 3, 2006 Messages 74 Location New Hampshire Programming Experience 5-10 Mar 7, 2006 #7 you could use the text.replace() method if you wrote a script/macro in the Visual Studio 2005 environment... those run inside of the IDE. http://aspnet.4guysfromrolla.com/articles/032305-1.aspx http://www.ondotnet.com/pub/a/dotnet/2002/12/09/vsmacros.html Upvote 0 Downvote
you could use the text.replace() method if you wrote a script/macro in the Visual Studio 2005 environment... those run inside of the IDE. http://aspnet.4guysfromrolla.com/articles/032305-1.aspx http://www.ondotnet.com/pub/a/dotnet/2002/12/09/vsmacros.html