Click here to Skip to main content
15,899,313 members
Home / Discussions / C#
   

C#

 
GeneralRe: Where's that article about Shell Toolbars? Pin
ThaRudeDude18-Jun-03 3:12
ThaRudeDude18-Jun-03 3:12 
GeneralXml Serialization Help Needed!! Pin
Ricardo Kirkner11-Jun-03 5:11
Ricardo Kirkner11-Jun-03 5:11 
GeneralRe: Xml Serialization Help Needed!! Pin
shaunAustin11-Jun-03 7:59
shaunAustin11-Jun-03 7:59 
GeneralRe: Xml Serialization Help Needed!! Pin
Ricardo Kirkner11-Jun-03 8:39
Ricardo Kirkner11-Jun-03 8:39 
GeneralAdding to common dialogs Pin
S O S11-Jun-03 4:14
S O S11-Jun-03 4:14 
GeneralFramework secury and exe files Pin
r911-Jun-03 4:07
r911-Jun-03 4:07 
GeneralListView Check Pin
chavezal11-Jun-03 3:20
chavezal11-Jun-03 3:20 
Generalstring.Replace Pin
Andy Hartley11-Jun-03 1:21
sussAndy Hartley11-Jun-03 1:21 
I have encountered a problem with string.Replace and String.Replace.

If I have:

string s = "Andrew Hartley";<br />
s.Replace( "Andrew", "A" );


s still holds "Andrew Hartley" and not "A Hartley" as I would expect!

This is the same for String.Replace also!!!

I have used Regex for the time being:

string s = "Andrew Hartley";<br />
Regex regex = new Regex( "Andrew" );<br />
s = regex.Replace( s, "A" );

s now holds the expected result of "A Hartley"

Does anyone have any comments to add, or any suggestions as to why string.Replace doesn't work?
GeneralRe: string.Replace Pin
Philip Fitzsimons11-Jun-03 2:50
Philip Fitzsimons11-Jun-03 2:50 
Generalweb service Pin
Dalia11-Jun-03 0:59
Dalia11-Jun-03 0:59 
GeneralRe: web service Pin
shaunAustin11-Jun-03 4:57
shaunAustin11-Jun-03 4:57 
GeneralNetwork Machines Pin
Nick Seng10-Jun-03 23:22
Nick Seng10-Jun-03 23:22 
GeneralRe: Network Machines Pin
shaunAustin11-Jun-03 0:02
shaunAustin11-Jun-03 0:02 
GeneralRe: Network Machines Pin
Nick Seng11-Jun-03 0:22
Nick Seng11-Jun-03 0:22 
GeneralRe: Network Machines Pin
shaunAustin11-Jun-03 5:18
shaunAustin11-Jun-03 5:18 
GeneralRe: Network Machines Pin
Nick Seng11-Jun-03 15:28
Nick Seng11-Jun-03 15:28 
GeneralRe: Network Machines Pin
shaunAustin11-Jun-03 22:50
shaunAustin11-Jun-03 22:50 
GeneralDynamic radioButtons Pin
haezeban10-Jun-03 23:04
haezeban10-Jun-03 23:04 
QuestionRemote File Access?? Pin
bania10-Jun-03 22:39
bania10-Jun-03 22:39 
AnswerRe: Remote File Access?? Pin
shaunAustin11-Jun-03 23:03
shaunAustin11-Jun-03 23:03 
QuestionIs there event before a window form closed? Pin
Xpelive10-Jun-03 22:02
Xpelive10-Jun-03 22:02 
AnswerRe: Is there event before a window form closed? Pin
J. Dunlap10-Jun-03 22:05
J. Dunlap10-Jun-03 22:05 
AnswerRe: Is there event before a window form closed? Pin
shaunAustin10-Jun-03 22:25
shaunAustin10-Jun-03 22:25 
AnswerRe: Is there event before a window form closed? Pin
Kannan Kalyanaraman10-Jun-03 22:30
Kannan Kalyanaraman10-Jun-03 22:30 
QuestionDoes C# have a string function like CString of C++ ? Pin
JeffSayHi10-Jun-03 21:38
JeffSayHi10-Jun-03 21:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.