【お知らせ】この部分は英語原文のみでの提供となります。何卒ご了承ください。
2.2.3.15.22 string::Left
Contents
Description
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.
Syntax
string Left( int nCount )
Parameters
- nCount
- [input]The number of characters to extract starting from the leftmost.
Return
A string object containing a copy of the specified range of characters. Note that the returned string object may be empty.
Examples
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); }
Remark
See Also
Header to Include
origin.h