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



TODO:

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

 

SOLUTION:

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

 

NOTES:

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

biuquote
  • Comment
  • Preview
Loading