| iMatix home page
| << | < | > | >>
SFL Logo SFL
Version 2.10

 

strcrop

#include "sflstr.h"
char *
strcrop (
    char *string)

Synopsis

Drops trailing whitespace from string by truncating string to the last non-whitespace character. Returns string. If string is null, returns null.

Source Code - (sflstr.c)

{
    char *last;

    if (string)
      {
        last = string + strlen (string);
        while (last > string)
          {
            if (!isspace (*(last - 1)))
                break;
            last--;
          }
        *last = 0;
      }
    return (string);
}

| << | < | > | >> iMatix Copyright © 1996-99 iMatix Corporation