how can i replace the double quote in vb.net?
it doesn't work this code
name.Replace("""," ")
how can i replace the double quote in vb.net?
it doesn't work this code
name.Replace("""," ")
You need to use a double quote within those quotes (and get the return value - String.Replace does not operate on the string itself, it returns a new string):
name = name.Replace(""""," ")
you should return the resultant string back to a string and also escape that double quotes with a double quote or "\"
name = name.Remove("""", String.Empty)
Instead of a "data link escaped" method of...
name = name.Replace("""", "")
You could be explicit and somewhat more readable...
name = name.Replace(ControlChars.DblQuote, "")
And BTW, instead of thinking of this as returning a NEW STRING; its better to think of the REPLACE as a part of the STRING Class associated with the 'name' instance. If its losing the old value of name that you do not want then simply...
Dim aNewString$ = name.Replace(ControlChars.DblQuote, "")
And 'name' will remain unchanged.