Re: [Q] Cleaning string whitespace trimming. Does it make any sense?

Dan Carpenter
2012-06-13T18:21:17Z

On Wed, Jun 13, 2012 at 03:16:24PM -0300, Ezequiel Garcia wrote:
> Dan,
>
> On Tue, Jun 12, 2012 at 5:58 PM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> > Actually, on second thought strim() already does what we want.  Just
> > ignore the return value.
> >
>
> If I *only* want to remove trailing whitespace, using strim() does the job
> but it *also* tries to remove leading whitespace.
>
> That can't hurt, but it also doesn't hurt to add a separate function
> for that, right?

It returns a pointer to the first non whitespace character, but you
can just ignore the return value. Normally the first character is
going to be non whitespace, so it's not even a slow down.

regards,
dan carpenter