escape char function

  • Thread starter Thread starter Cheung
  • Start date Start date
C

Cheung

Guest
Do you know any function that change ' (single quote) to '' (2 single quotes) in a string?
 
There aren't escape characters in VB.NET. You can use two double quotes ("") next to each other to have an inline double quote in a string, e.g.

Code:
strString = "This ""word"" is enclosed in double quotes."
 
Any function to do this for me?

function input string = It isn't bad
function output string = It isn''t bad

Thx!
 
Code:
Dim MyString as String = "'Hello My Name Is Simon'"

MyString.replace( "'", Chr(34) )

*Should Work* :)

Or you could just write it out using Chr(34) but who wants to do that ? :)
 
Back
Top