Link to home
Start Free TrialLog in
Avatar of hankknight
hankknightFlag for Canada

asked on

ASP.NET/VB: Trim quotation marks from beginning and end

Using ASP.NET/VB, I would like to trim quotation marks from the beginning and end.

These charactors should be REMOVED if they are the first or last character of the Headline.

"“”
<h2><%#Container.DataItem("Headline")%></h2>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of strickdd
strickdd
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of hankknight

ASKER

Thanks.  disrupt, this needs to be VB not C#.
"TrimStart and TrimEnd are supposed to take a character array as a parameter. If you type the keyword null instead, it will trim the white space (blank characters)."

you can also just do this:

returnValue.TrimStart( '" ', '“','”' );
returnValue.TrimEnd( '" ', '“','”' );
It will work in vb .net fine just leave out the semicolon at the end :)
Thanks, disrupt.   I awarded the points just moments before you made your post.

strickdd, you solution works.