By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,916 Members | 1,286 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,916 IT Pros & Developers. It's quick & easy.

comment on FAQ item 4.16 "trim whitespace"

P: n/a
White space includes \t\r\n\v\f.

I wrongly took it to mean just spaces " " so when I ran the 'trim'
function it stripped some of my formatting.

Perhaps the FAQ item should either include a definition for white space
or the code be modified to only trim spaces?

Andrew Poulos
Jan 31 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Andrew Poulos wrote:
White space includes \t\r\n\v\f.

I wrongly took it to mean just spaces " " so when I ran the 'trim'
function it stripped some of my formatting.

Perhaps the FAQ item should either include a definition for white space
or the code be modified to only trim spaces?
This is the normal definition of "white space" throughout the world of
computers.
--
John W. Kennedy
"The grand art mastered the thudding hammer of Thor
And the heart of our lord Taliessin determined the war."
-- Charles Williams. "Mount Badon"
Feb 1 '08 #2

P: n/a
In comp.lang.javascript message <47***********************@cv.net>, Thu,
31 Jan 2008 22:06:26, John W. Kennedy <jw*****@attglobal.netposted:
>Andrew Poulos wrote:
>White space includes \t\r\n\v\f.
I wrongly took it to mean just spaces " " so when I ran the 'trim'
function it stripped some of my formatting.
Perhaps the FAQ item should either include a definition for white
space or the code be modified to only trim spaces?

This is the normal definition of "white space" throughout the world of
computers.
One should not presume that those who need to read the FAQ are so widely
aware, especially in the presence of a counter-example.

"To trim only ordinary spaces, replace '\s' by '[ ]' or '\x20' or
'\u0020'." could easily be added and would illustrate other points.

--
(c) John Stockton, nr London UK. ?@merlyn.demon.co.uk Delphi 3 Turnpike 6.05
<URL:http://www.merlyn.demon.co.uk/TP/BP/Delphi/&c., FAQqy topics & links;
<URL:http://www.bancoems.com/CompLangPascalDelphiMisc-MiniFAQ.htmclpdmFAQ;
<URL:http://www.borland.com/newsgroups/guide.htmlnews:borland.* Guidelines
Feb 2 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.