C#/.NET Little Wonders: The String Remove() and Replace() Methods

added by BlackRabbitCoder
9/16/2011 2:30:13 PM

174 Views

When manipulating string data, many times you want to either remove parts of a String or replace characters in a String. You can do this yourself, of course, by building a new String while manually inspecting each char in turn, but this gets to be a bit expensive and is less maintainable. Instead, there are two methods in the String class, ready to use, that let you do this easily: Remove() and Replace().


0 comments