vbscript - Escape and replace quotations in VBS -
i need escape character " replacing in vbs
i write
str=8505usafromto^1c0"ma str = replace(str,chr(34),"""")
but seems " not escape string str
please, what's wrong , me fix that?
thanks
string literals need double quotes:
str = "8505usafromto^1c0 ma"
to escape double quote in string literal, use "" (double double quotes)
str = "8505usafromto^1c0""ma"
it makes no sense replace double quotes (chr(34)) in string double quotes ("""").
update:
if .readall()/.readline() string file , want change " in string, use
str = replace(str, """", "that's want see instead of each double quote")
in case want "" (double double quotes) replacements, need """""" (2 delimiters , 2 times 2 double quotes).