473,394 Members | 1,742 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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 ?
Nov 18 '05 #1
2 963
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:eF**************@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
?

Nov 18 '05 #2
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:OA**************@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:eF**************@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 ?


Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

22
by: Simon | last post by:
Hi, I have written a function to trim char *, but I have been told that my way could be dangerous and that I should use memmove(...) instead. but I am not sure why my code could be 'dangerous'...
4
by: Matt | last post by:
I want to confirm there is not built-in trim() function in javascript. If I need one, I need to implement my own needs. please advise. Thanks!!
11
by: Darren Anderson | last post by:
I have a function that I've tried using in an if then statement and I've found that no matter how much reworking I do with the code, the expected result is incorrect. the code: If Not...
31
by: rkk | last post by:
Hi, I've written a small trim function to trim away the whitespaces in a given string. It works well with solaris forte cc compiler, but on mingw/cygwin gcc it isn't. Here is the code: char...
27
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I trim whitespace - LTRIM/RTRIM/TRIM?...
4
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I trim whitespace - trim/trimRight/trimLeft...
2
by: RobG | last post by:
There is an interseting examination of varions trim functions here: <URL: http://blog.stevenlevithan.com/archives/faster-trim-javascript > The best all-round function seems to be trim3 when...
8
by: Kevin Smith | last post by:
Hi, According to the intellisense help, string.Trim() "Removes all occurances or white space characters from the beginning and end of this instance." However, the follow code does not appear...
2
by: Peter Duniho | last post by:
On Wed, 08 Oct 2008 11:26:01 -0700, Kevin Smith <no@spam.comwrote: No, it wouldn't. Nor would it modify the String instance that s refers to. Strings are immutable. They are _never_...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.