.net equivilent of Delphi's QuotedStr function

.net, c#, delphi

Solution

Like this:

"'" + str.Replace("'", "''") + "'"

Problem

Does .net have the equivilent of Delphi's QuotedStr function. This replaces all quotes with two quote characters and then adds a quote to the start and the end, e.g. Lets assume the varaible s holds the string: ``` Welcome to Steve's Store ``` then `QuotedStr(s)` would return: ``` 'Welcome to Steve''s Store' ```

Original source