本文整理汇总了C++中WideString::replace方法的典型用法代码示例。如果您正苦于以下问题:C++ WideString::replace方法的具体用法?C++ WideString::replace怎么用?C++ WideString::replace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WideString
的用法示例。
在下文中一共展示了WideString::replace方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetAppliedChanges
WideString UITextField::GetAppliedChanges(int32 replacementLocation, int32 replacementLength, const WideString & replacementString)
{//TODO: fix this for copy/paste
WideString txt = GetText();
if(replacementLocation >= 0)
{
txt.replace(replacementLocation, replacementLength, replacementString);
}
return txt;
}
示例2: untabify
void Editor::untabify(WideString& text)
{
int width = settings->tabSize;
for (int i = 0; text[i]; i++)
{
if (text[i] == '\t')
{
text.replace(i, ' ');
//int extra = (width - (i % width)) - 1;
//for (int i = 0; i < extra; i++)
// text.insert(i, ' ');
}
}
}
示例3: TextFieldKeyPressed
bool InputTest::TextFieldKeyPressed(UITextField * textField, int32 replacementLocation, int32 replacementLength, const WideString & replacementString)
{
if (replacementLocation < 0 || replacementLength < 0)
{
staticText->SetText(L"");
return true;
}
WideString resultString = textField->GetText();
resultString.replace(replacementLocation, replacementLength, replacementString);
staticText->SetText(resultString);
return true;
}
示例4: TextFieldKeyPressed
bool UITextFieldAndroid::TextFieldKeyPressed(int32 replacementLocation, int32 replacementLength, const WideString &text)
{
bool res = true;
UITextFieldDelegate* delegate = textField->GetDelegate();
if (delegate)
res = delegate->TextFieldKeyPressed(textField, replacementLocation, replacementLength, text);
if (res)
{
WideString curText = textField->GetText();
if (curText.length() >= replacementLocation)
{
curText.replace(replacementLocation, replacementLength, text);
this->text = curText;
}
}
return res;
}