Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Replace Character 1

Status
Not open for further replies.

hugh999

MIS
Nov 29, 2001
129
IE
Hi

How do you replace a character in a string.

Using a command buttton, I am trying to replace the charcater '\' in a textBox with the character '-'.

Thanks
 
Found code in the Help.
string.Replace ('\\', '-')
 
Use:

Code:
string textStr = @"Hello\This\Is\A\Text";
testStr = testStr.Replace('\\', '-');
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top