Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/perlfaq4.pod
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,7 @@ implementing it yourself is highly recommended; you'll save yourself odd bugs
popping up later by just using code which has already been tried and tested in
production for years.

=head2 How do I strip blank space from the beginning/end of a string?
=head2 How do I trim a string to strip blank space from the beginning/end?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you are going to change the title, a better one would be "How do I trim a string". If you think they know what trim is, they don't need the rest of the words.

Copy link

@briandfoy briandfoy Apr 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But, also consider the people who haven't used other languages and haven't encountered trim.

Thinking about this, I think this change might wait for a trim to show up in Perl, which might be soon.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see this more as a combination of using the English verb "trim" with it coincidentally being the name of this common operation. Thus the additional explanation helps describe that it's referring to blank space specifically.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was shooting for keeping perldoc -q working, but to that end I would probably go with "remove space" as something people might search for. But, overall, it seemed as though folks thought that "trim" was the most common spelling for doing this to a string. I'm not much on SEO though, so whatever folks think is a good title. I thought this might make perl 5.34 while I'm sure trim won't.

How do I trim a string to remove whitespace from the beginning/end?


(contributed by brian d foy)

Expand Down