Saturday, March 31, 2012

trim and pure apparently whitespace strings

has anyone encountered an apparently pure whitespace string (debug mode
mouse-over) that when TRIM'd does not result in a null-string ?

how to determine any special characters that may be present in the string ?trimming a string with just spaces will return an empty string ("") not a
null string (null)...

The easiest way to evaluate the string would be to write it to disk. Create
a file and write the string out, then analyse the file in a hex editor to
check for excape characters.

"John A Grandy" <johnagrandy-at-yahoo-dot-com> wrote in message
news:eFtfjQG0EHA.1264@.TK2MSFTNGP12.phx.gbl...
> has anyone encountered an apparently pure whitespace string (debug mode
> mouse-over) that when TRIM'd does not result in a null-string ?
> how to determine any special characters that may be present in the string
> ?
i was using "null-string" in the traditional sense of a reference to a
String datatype object that consists of 0 characters -- not a
"null-reference" (a reference to Nothing)

actually, i found this very useful function for discovering hidden
characters in a string:

Uri.HexEscape()

"Dan Bass" <danielbass [at] postmaster [dot] co [dot] uk> wrote in message
news:OAfw44H0EHA.2600@.TK2MSFTNGP09.phx.gbl...
> trimming a string with just spaces will return an empty string ("") not a
> null string (null)...
> The easiest way to evaluate the string would be to write it to disk.
Create
> a file and write the string out, then analyse the file in a hex editor to
> check for excape characters.
>
> "John A Grandy" <johnagrandy-at-yahoo-dot-com> wrote in message
> news:eFtfjQG0EHA.1264@.TK2MSFTNGP12.phx.gbl...
> > has anyone encountered an apparently pure whitespace string (debug mode
> > mouse-over) that when TRIM'd does not result in a null-string ?
> > how to determine any special characters that may be present in the
string
> > ?

0 comments:

Post a Comment