string类的字符操作

const char &operator[](int n)const;
const char &at(int n)const;
char &operator[](int n);
char &at(int n); operator[]和at()均返回当前字符串中第n个字符的位置,但at函数提供范围检查,当越界时会抛出out_of_range异常下标运算符[]不提供检查访问

const char *data()const;//返回一个非null终止的c字符数组
const char *c_str()const;//返回一个以null终止的c字符串
int copy(char *s, int n, int pos = 0) const;//把当前串中以pos开始的n个字符拷贝到以s为起始位置的字符数组中,返回实际拷贝的数目
注:对于string中对象字符的处理,有很多已有的函数在CCtype头文件中,可以很方便的应用