Does anyone have any code examples of string replace?
I have a string of the following format :
ABCDEF123456
I need to get the ABCDEF to 0's (zeros) so it looks like :
000000123456
Any help is appreciated greatly
Bill
Printable View
Does anyone have any code examples of string replace?
I have a string of the following format :
ABCDEF123456
I need to get the ABCDEF to 0's (zeros) so it looks like :
000000123456
Any help is appreciated greatly
Bill
string thestring = "ABCDEF123456";
thestring = thestring.Replace("ABCDEF", "000000");
There is a replace function with string? Cool have to check that out I resorted to regex.
pseuHalfWords[j-1] = Regex.Replace(pseuHalfWords[j-1], "ABC", "000");
thanks hellswraith,
Bill
Regular Expressions are probably a better idea still. The String.Replace method doesn't know any wildcards or such.
replace "[A-F]" with "0"