Mid
Extract a substring of length nCount characters from this string object, starting at position nFirst (zero-based).
Extract a substring from this string object. The range is starting at position nFirst (zero-based) and up to the end of string object.
string Mid( int nFirst, int nCount )
string Mid( int nFirst )
Returns a copy of the extracted substring.
EX1
void string_Mid_ex1() { string str1("I love summer!"); string str2 = str1.Mid(2,4); //the the extracted substring should be "love" printf("the extracted substring is \"%s\" \n", str2); }
EX2
void string_Mid_ex2() { string str1("I love summer!"); string str2=str1.Mid(2); //the the extracted substring should be "love summer" printf("the extracted substring is \"%s\" \n", str2); }
string::Left, string::Right
origin.h