Thanks Joe,
Thank you to all that responded to my post...
After looking at your solution and those of others that also provided
an answer, I choose to roll-my-own. It's not a difficult routine to
write and I didn't want the expense or overhead of a plug-in (some
solutions were not free) for just one simple routine. You answered my
question enough for me to make an intelligent decision on how I
should proceed. For those who wish to pipe in that their routines are
much faster, well I will not doubt that they are, please send me the
code specifically for stripping out the control characters from a
string, and show me. Otherwise I guess I'm good.
Craig
Message: 10
Subject: Re: Filename String Strangeness
From: [EMAIL PROTECTED]
Date: Wed, 7 Jun 2006 08:46:58 -0600
On Jun 07, 2006, at 02:24 UTC, Craig Hoyt wrote:
They have
either a CR or LF for a fifth character in its name. There are
others. Is there a RegEx or encoding way to strip out all hidden
characters in a string? Or, is there another way - other than the
obvious way of walking the string and examining each character. I
guess what I'm trying to say is there an elegant way of doing this?
If you know they'll be at the beginning or end of the name, then a
simple Trim() should do it. If not, then you might use s =
StringUtils.Remove(s, StringUtils.ControlCharacters). This is part
of the free String Utilities module at <http://www.verex.com/
opensource/>.
It could be done with RegEx too, but it'd be more work and probably
less efficient.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>