.net equivilent Delphi QuotedStr Functions

Does .net have the Delphi QuotedStr function equivalent? This replaces all quotation marks with two quotation marks, and then adds the quote to the beginning and end, for example.

Suppose varaible s contains the string:

Welcome to Steve Store

then QuotedStr(s)will return:

'Welcome to Steve' Store'
+3
source share
1 answer

Like this:

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

Source: https://habr.com/ru/post/1735914/


All Articles