CCL Home Page
Up Directory CCL notrail
#include "utility.h"

char *notrail(string,trailing_char)
/*============================================================================*/
/* PURPOSE: REMOVE TRAILING CHARACTERS FROM A STRING.
/* INPUTS:
/*	STRING			STRING POSSIBLY CONTAINING TRAILING CHARACTERS.
/*	TRAILING_CHAR		TRAILING CHARACTER TO REMOVE.
/* OUTPUTS:
/*	STRING			ORIGINAL STRING WITH TRAILING_CHAR REMOVED.
/*	FUNCTION VALUE		POINTER TO STRING WITH TRAILING CHARACTERS
/*				REMOVED.
/* WRITTEN: M.V.GRIESHABER
/* LAST MODIFICATION: 11 JUNE 1991 MVG
*/
   char string[];
   char trailing_char;
   {
   int i;

   /* REMOVE ALL TRAILING_CHAR CHARACTERS BY REPLACING THEM WITH NULLS. */
   i=strlen(string)-1;
   while (i>=0 && string[i]==trailing_char)
      {
      string[i--]=0;
      }

   return(string);
   }
Modified: Fri Feb 11 17:00:00 1994 GMT
Page accessed 4872 times since Sat Apr 17 21:58:59 1999 GMT