使用wxWidgets進行跨平台程式開發-zetcode_wxWidgets_helper_classes04(改寫)
資料來源:http://zetcode.com/gui/wxwidgets/helperclasses/
zetcode_wxWidgets_helper_classes04(console application、wxPuts命令模式文字輸出-有換行、wxString.Contains搜尋關鍵字)
#include <wx/string.h>
/*
http://zetcode.com/gui/wxwidgets/helperclasses/
Console
The following example checks, whether a string contains another string. For this we have a Contains() method.
*/
int main(int argc, char **argv)
{
wxString str = wxT("The history of my life");
if (str.Contains(wxT("history"))) {
wxPuts(wxT("Contains!"));
}
if (!str.Contains(wxT("plain"))) {
wxPuts(wxT("Does not contain!"));
}
}
沒有留言:
張貼留言