How do you eliminate or add " to a string
Author: rmandel00
Creation Date: 5/18/2011 12:23 PM
profile picture

rmandel00

#1
I'm comparing two strings. One has quotes around it and the other doesn't. I need to either strip the quotes from the one or add them to the other to have a match. I tried """+ ... and chr(34)+ ... at beginning and end of the string but neither was correct syntax. Thanks
profile picture

Eugene

#2
There must be a million ways of doing it in C#. Just a couple off the top of my head. Suppose that a is the string that contains leading/trailing quotes and q is your naughty char:
CODE:
Please log in to see this code.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).