From: robin on

"Lothar Behrens" <lothar.behrens(a)lollisoft.de> wrote in message
news:791ef0f2-c2d3-4e09-ac1b-5fc0c39f05b2(a)l36g2000yqb.googlegroups.com...
| Hi,
|
| I have implemented a trim function and documented it as follows:
|
| /** \brief Trim trailing spaces.
| *
| * Removes the trailing spaces in the string.
| */
| void trim();
|
| But actually I have written a test to ensure it's correctness and
| assumed it would remove leading and trailing whitespaces.

Why would you assume that?, as you have written
that it removes white space from the END of the string.

| I know there are rtrim and ltrim in some languages or implementations.

In PL/I there is the TRIM function whose simple form
removes blanks from the beginning and end of a string.
When provided with additional arguments, it can trim blanks from either end,
and it can trim any characters or any of a list of characters
from either end or both ends.


 | 
Pages: 1
Prev: "Variable Depth" Problem
Next: #include "cpuid.os"