hankknight
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.
"“”
These charactors should be REMOVED if they are the first or last character of the Headline.
"“”
<h2><%#Container.DataItem("Headline")%></h2>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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( '" ', '“','”' );
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 :)
ASKER
Thanks, disrupt. I awarded the points just moments before you made your post.
strickdd, you solution works.
strickdd, you solution works.
http://www.homeandlearn.co.uk/csharp/csharp_s8p2.html