[[TableOfContents]] === 첫번째 구분자로 자르기 === {{{#!gcode CString str = _T("AAAA\\BBBB\\CCCC"); CString strCutted = str.Left(str.Find(_T('\\'))); }}} ---- {{{ AAAA\\BBBB\\CCCC -> AAAA }}} === 마지막 구분자로 자르기 === {{{#!gcode CString str = _T("AAAA\\BBBB\\CCCC"); CString strCutted_1 = str.Right(str.GetLength() - str.ReverseFind(_T('\\')) - 1); CString strCutted_2 = str.Right(str.GetLength() - str.ReverseFind(_T('\\'))); }}} ---- {{{ strCutted_1 AAAA\\BBBB\\CCCC -> CCCC strCutted_2 AAAA\\BBBB\\CCCC -> \\CCCC }}} === 마지막 구분자까지 자르기 === {{{#!gcode CString str = _T("AAAA\\BBBB\\CCCC"); CString strCutted_1 = str.Left(str.GetLength() - str.ReverseFind(_T('\\'))); CString strCutted_2 = str.Left(str.GetLength() - str.ReverseFind(_T('\\')) + 1); }}} ---- {{{ strCutted_1 AAAA\\BBBB\\CCCC -> AAAA\\BBBB strCutted_2 AAAA\\BBBB\\CCCC -> AAAA\\BBBB\\ }}} === 글자 자수로 잘라서 나눔 === {{{#!gcode std::wstring wcontent = L"lo~~~ng text"; std::vector v; size_t previous = 0; size_t cur = 0; while (cur < wcontent.length()) { cur += 240; std::wstring sub = wcontent.substr(previous, cur); v.push_back(sub); int sub_len = sub.length(); previous = cur; } for (std::wstring sub : v) { // TODO: } }}} ---- {{{ L"lo~~ng text" : 496 length -> v[0] : 240 length v[1] : 240 length v[2] : 16 length }}}