|
-
Apr 15th, 2003, 04:24 PM
#1
Thread Starter
Hyperactive Member
String Replace??
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
-
Apr 15th, 2003, 04:45 PM
#2
PowerPoster
string thestring = "ABCDEF123456";
thestring = thestring.Replace("ABCDEF", "000000");
-
Apr 15th, 2003, 04:54 PM
#3
Thread Starter
Hyperactive Member
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
-
Apr 17th, 2003, 01:50 AM
#4
Regular Expressions are probably a better idea still. The String.Replace method doesn't know any wildcards or such.
replace "[A-F]" with "0"
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|