Left
Extract the leftmost nCount characters from this string object and returns a copy of the extracted substring. If nCount exceeds the string length, then the entire string is extracted.
string Left( int nCount )
A string object containing a copy of the specified range of characters. Note that the returned string object may be empty.
EX1
void string_Left_ex1() { string str1("abcdef"); string str2 = str1.Left(3); //after extracted,str2 should be "abc" printf("the extracted substring is \"%s\"\n", str2); }
string::Right
origin.h