home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
magazine
/
drdobbs
/
1991
/
10
/
string
/
strifunc.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1991-07-30
|
391b
|
18 lines
#include <string.h>
#include <ctype.h>
#include <errno.h>
#include <string.hpp>
String String::operator()(int start, int len)
{
if (len < 0 || start < 0 || start >= length()) {
errno = ERANGE;
String t;
return t;
} else {
if (length()-start < len) len = length()-start;
String t(body()+start, len);
return t;
}
}