How To Find A String And Replace It With Another String Using C#


Have you ever wanted to replace a string that exists in another string?



string foo = "123456-7890-abcd";
string bar = foo.Replace("-", "");



The example above will replace '-' with an empty string.  The result will be 1234567890abcd.

Comments (1) -

save my marriage
save my marriage
4/6/2015 12:50:14 PM #

Hey very nice site!! Guy .. Excellent .. Wonderful .. I'll bookmark your website and take the feeds additionally? I am satisfied to search out so many helpful info here within the post, we'd like develop more strategies on this regard, thanks for sharing. . . . . .

Add comment

  Country flag

  • Comment
  • Preview