469,887 Members | 1,838 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,887 developers. It's quick & easy.

trim a single quote from string

I have been trying to use TrimEnd() to eliminate a single quote from the end
of a string. I have used "'", ''', and a few others without success. Does
anyone have experience with TrimEnd()?
Sep 11 '06 #1
3 6188
The method takes an array of characters as its argument.

--
HTH,

Kevin Spencer
Microsoft MVP
Chicken Salad Surgery

What You Seek Is What You Get.

"Mitch" <Mi***@discussions.microsoft.comwrote in message
news:E3**********************************@microsof t.com...
>I have been trying to use TrimEnd() to eliminate a single quote from the
end
of a string. I have used "'", ''', and a few others without success.
Does
anyone have experience with TrimEnd()?

Sep 11 '06 #2
How to define an array of characters ?

"Kevin Spencer" <uc*@ftc.govwrote in message
news:uj**************@TK2MSFTNGP05.phx.gbl...
The method takes an array of characters as its argument.

--
HTH,

Kevin Spencer
Microsoft MVP
Chicken Salad Surgery

What You Seek Is What You Get.

"Mitch" <Mi***@discussions.microsoft.comwrote in message
news:E3**********************************@microsof t.com...
>>I have been trying to use TrimEnd() to eliminate a single quote from the
end
of a string. I have used "'", ''', and a few others without success.
Does
anyone have experience with TrimEnd()?


Oct 18 '06 #3
Alan T <al*************@yahoo.com.auwrote:
How to define an array of characters ?
In the case of TrimEnd, you can specify the array just by giving the
characters, or the single character in your case:

x.TrimEnd ('\'');

That's because the parameter is declared with the "params" modifier.
Otherwise you'd have to do:

x.TrimEnd (new char[] { '\'' });

I would *strongly* recommend that if you're still fairly unfamiliar
with C# that you lean the basics thoroughly before moving onto things
like threading and GUI code. Threading can be tricky at the best of
times, but you'll find it a lot harder if you're still trying to get to
grips with the language itself.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Oct 18 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

22 posts views Thread by Simon | last post: by
13 posts views Thread by Jonathan Wood | last post: by
22 posts views Thread by Terry Olsen | last post: by
3 posts views Thread by Pascal | last post: by
31 posts views Thread by rkk | last post: by
8 posts views Thread by Kevin Smith | last post: by
8 posts views Thread by Keith Thompson | last post: by
1 post views Thread by Waqarahmed | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.