home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Interactive Guide
/
c-cplusplus-interactive-guide.iso
/
c_ref
/
csource4
/
273_01
/
trimr.cc
< prev
next >
Wrap
Text File
|
1987-09-27
|
457b
|
19 lines
trim_r(char *str)
/* This will trim all blanks characters from the rigth side of the
string pointed to by *str.
*/
{
char *s_str;
int str_len;
str_len=strlen(str);
if(!str_len) return(0);
s_str=str;
str=str + str_len - 1;
while((*str==' ') && str_len) {
str--; str_len--;
}
*(str+1)=0x00;
str_len=strlen(s_str);
return(str_len);
}