comment on FAQ item 4.16 "trim whitespace"

A

Andrew Poulos

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
 
J

John W. Kennedy

Andrew said:
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.
 
D

Dr J R Stockton

Thu said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
474,078
Messages
2,570,570
Members
47,204
Latest member
MalorieSte

Latest Threads

Top