home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Interactive Guide
/
c-cplusplus-interactive-guide.iso
/
c_ref
/
csource4
/
273_01
/
triml.cc
< prev
next >
Wrap
Text File
|
1987-09-27
|
505b
|
20 lines
trim_l(char *str)
/* This will remove all blanks from the left side of the string
pointed to by *str.
*/
{
int non_blank_found = 0;
char *newstr;
newstr=str;
while(*str) {
if(*str==' ' && !non_blank_found)
str++;
else {
non_blank_found=1;
*newstr=*str;
newstr++; str++;
}
}
*newstr=0x00;
}