C# string replace

Bobcat88 picture Bobcat88 · May 30, 2013 · Viewed 152.6k times · Source

I want to replace "," with a ; in my string.

For example:

Change

"Text","Text","Text",

to this:

"Text;Text;Text",

I've been trying the line.replace( ... , ... ), but can't get anything working properly.

Answer

DonBoitnott picture DonBoitnott · May 30, 2013

Try this:

line.Replace("\",\"", ";")