本文整理汇总了C++中CFSWString::Delete方法的典型用法代码示例。如果您正苦于以下问题:C++ CFSWString::Delete方法的具体用法?C++ CFSWString::Delete怎么用?C++ CFSWString::Delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFSWString
的用法示例。
在下文中一共展示了CFSWString::Delete方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: while
CFSArray<CFSWString> do_utterances(CFSWString s) {
CFSWString res = empty_str;
CFSArray<CFSWString> res_array;
if (s.GetLength() == 1)
res_array.AddItem(s);
else
for (INTPTR i = 0; i < s.GetLength(); i++) {
CFSWString c = s.GetAt(i);
CFSWString pc = res.GetAt(res.GetLength() - 1);
CFSWString nc = s.GetAt(i + 1);
CFSWString nnc = s.GetAt(i + 2);
if (is_ending(c) && is_whitespace(nc) && is_upper(nnc)) {
res.Trim();
res_array.AddItem(res);
res = empty_str;
} else
if (is_tab(c)) {
if (res.GetLength() > 0) {
res.Trim();
res_array.AddItem(res);
res = empty_str;
}
} else
res += c;
}
res.Trim();
if (res.GetLength() > 0) {
while (is_ending(res.GetAt(res.GetLength() - 1))) {
res.Delete(res.GetLength() - 1, 1);
}
res_array.AddItem(res);
}
for (INTPTR i=0; i < res_array.GetSize(); i++) {
if (is_ending(res_array[i].GetAt(res_array[i].GetLength()-1)))
res_array[i].Delete( res_array[i].GetLength()-1, 1 );
}
return res_array;
}
示例2: the_shift
CFSWString the_shift(CFSWString s) {
/*
On mingi võimalus, et lihtsustus tuleb teha kahes astmes. LQ-ta ja LQ-ga (vt shift_pattern). Kõik
seotud sellega, et pole vältenihutusreeglitest lõpuni aru saanud. Eksisteerib Mihkla versioon ja
ametlik versioon. Tänud Mihklale, kes kala asemel annab tattninale õnge, see õpetab ujuma.
Maadlesin õngega pikalt.
*/
CFSWString res;
CFSWString code;
INTPTR pos;
INTPTR i = 0;
INTPTR x;
while (s.GetLength() > 0) {
CFSWString c = s.GetAt(0);
s.Delete(0, 1);
if (is_uvowel(c)) {
c = c.ToLower();
code += shift_pattern(c);
res += c;
pos = i;
} else
if (c == d && code.GetLength() > 0) {
res += c;
code += c;
CFSWString t_code = code;
t_code += shift_pattern(s.GetAt(0));
x = pattern_lookup(t_code); //orig üle silbipiiri
if (x > -1) {
x += pos;
if (x > res.GetLength()) { // kui kargab järgmisse silpi
x = x - res.GetLength();
s.Insert(x, colon);
} else
res.Insert(x, colon);
i++;
} else {
t_code = simplify_pattern(t_code);
x = pattern_lookup(t_code); //liht üle silbipiiri
if (x > -1) {
x += pos;
if (x > res.GetLength()) { // kui kargab järgmisse silpi
x = x - res.GetLength();
s.Insert(x, colon);
} else
res.Insert(x, colon);
i++;
} else {
x = pattern_lookup(code); //orig
if (x > -1) {
x += pos;
res.Insert(x, colon);
i++;
} else {
code = simplify_pattern(code);
x = pattern_lookup(code); //liht
if (x > -1) {
x += pos;
res.Insert(x, colon);
i++;
}
}
}
}
code = empty_str;
} else {
res += c;
if (code.GetLength() > 0) {
code += shift_pattern(c);
}
}
i++;
} //while
// sõna lõpus
if (code.GetLength() > 0) {
code += L"#";
//imelik koht ainult "lonksu" pärast
if ((code.Left(3) == L"VLQ") && ((code.GetAt(3) == L's') || (code.GetAt(3) == L'h') || (code.GetAt(3) == L'v') || (code.GetAt(3) == L'j'))) {
code = L"VLQC#";
}
INTPTR x = pattern_lookup(code);
if (x > -1) {
x += pos;
res.Insert(x, colon);
} else {
code = simplify_pattern(code);
x = pattern_lookup(code);
if (x > -1) {
x += pos;
res.Insert(x, colon);
}
}
code = empty_str;
}
return res;
}