{"id":3745,"date":"2021-12-11T06:03:53","date_gmt":"2021-12-11T06:03:53","guid":{"rendered":"http:\/\/truelogic.org\/wordpress\/?p=3745"},"modified":"2021-12-11T06:41:01","modified_gmt":"2021-12-11T06:41:01","slug":"2b-wxwidgets-wxstring","status":"publish","type":"post","link":"https:\/\/truelogic.org\/wordpress\/2021\/12\/11\/2b-wxwidgets-wxstring\/","title":{"rendered":"2b.wxWidgets &#8211; wxString"},"content":{"rendered":"\n<p><strong>OVERVIEW<\/strong><\/p>\n\n\n\n<p>Strings are used in every application so the wxString class is something which will be used very often. Given below is code which shows the various basic string functions available.<\/p>\n\n\n\n<p><strong>SAMPLE CODE<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">strings.cpp<\/pre>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\n#include &lt;wx\/wxprec.h&gt;\n#ifndef WX_PRECOMP\n\t#include &lt;wx\/wx.h&gt;\n#endif\n#include &lt;wx\/string.h&gt;\n\nint main(int argc, char **argv) {\n\twxInitialize();\n\t\n\twxString str1 = wxT(&quot;First &quot;);\n\twxString str2 = wxT(&quot;Second &quot;);\n\twxString str3 = wxT(&quot;Third &quot;);\n\n\twxPuts(wxT(&quot;Concatenating:\\n&quot;));\n\twxPuts(str1 + str2 + str3);\n\twxPuts(wxT(&quot;\\nAppending:\\n&quot;));\n\twxPuts(str1.Append(str3));\n\twxPuts(wxT(&quot;\\nLength and Format:\\n&quot;));\n\twxString strLen = wxString::Format(wxT(&quot;Length is %zu&quot;), str1.Length());\n\twxPuts(strLen);\n\twxPuts(wxT(&quot;\\nCase:\\n&quot;));\n\twxPuts(str1.Upper() + wxT(&quot; &quot;) + str1.Lower() + wxT(&quot; &quot;) + str1.Capitalize());\n\twxPuts(wxT(&quot;\\nExtraction:\\n&quot;));\n\twxPuts(str1.Left(3) + wxT(&quot; &quot; ) + str1.Right(2) + wxT(&quot; &quot;) + str1.Mid(2,3));\n\twxPuts(wxT(&quot;\\nSearch:\\n&quot;));\n\tif (str1.Contains(&quot;irst&quot;))\n\t\twxPuts(str1 + wxT(&quot; contains irst&quot;));\n\tif (str1.Find(&quot;dssd&quot;) == wxNOT_FOUND)\n\t\twxPuts(str1 + wxT(&quot; could not find dssd&quot;));\n\n\twxUninitialize();\n}\n\n<\/pre><\/div>\n\n\n<p>The output is given below:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Concatenating:\n First Second Third \n Appending:\n First Third \n Length and Format:\n Length is 12\n Case:\n FIRST THIRD  first third  First third \n Extraction:\n Fir d  rst\n Search:\n First Third  contains irst\n First Third  could not find dssd<\/pre>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>OVERVIEW Strings are used in every application so the wxString class is something which will be used very often. Given below is code which shows <a class=\"mh-excerpt-more\" href=\"https:\/\/truelogic.org\/wordpress\/2021\/12\/11\/2b-wxwidgets-wxstring\/\" title=\"2b.wxWidgets &#8211; wxString\">[&#8230;]<\/a><\/p>\n<\/div>","protected":false},"author":1,"featured_media":3595,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[302,365],"tags":[],"class_list":["post-3745","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cc","category-wxwidgets"],"_links":{"self":[{"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/posts\/3745","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/comments?post=3745"}],"version-history":[{"count":2,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/posts\/3745\/revisions"}],"predecessor-version":[{"id":3763,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/posts\/3745\/revisions\/3763"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/media\/3595"}],"wp:attachment":[{"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/media?parent=3745"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/categories?post=3745"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/tags?post=3745"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}