I would like to search for text in a string and then replace the values like notepad does. How do I do this without parsing the entire string char by char?
C# has a few methods particularly for this...
you are going to want to use the indexof property...
I believe it is something a long the lines of string.indexof("stringtofind")
this can be used with many other properties and functions to get you what you need. I don't have the time to look up all of them but maybe this will point you in the right dirrection.
System.String.Replace if you don't need anything fancy.
Otherwise, look into the System.Text.RegEx (Regular Expressions) namespace.
So I just use code like
Code:text = System.String.Replace("text","string");
Yes
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks