.net 是否具有与 Delphi 的 QuotedStr 函数等效的功能。这会将所有引号替换为两个引号字符,然后在开头和结尾添加一个引号,例如
让我们假设变量 s 包含字符串:
Welcome to Steve's Store
然后 QuotedStr(s)
将返回:
'Welcome to Steve''s Store'
最佳答案
像这样:
"'" + str.Replace("'", "''") + "'"
关于c# - .net 相当于 Delphi QuotedStr 函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2401300/