{"id":673,"date":"2016-12-22T14:27:23","date_gmt":"2016-12-22T14:27:23","guid":{"rendered":"https:\/\/ibex.tech\/windows-iot\/?p=305"},"modified":"2022-09-13T14:46:31","modified_gmt":"2022-09-13T13:46:31","slug":"working-with-strings","status":"publish","type":"post","link":"https:\/\/ibex.tech\/csharp\/uwp-programming-in-c\/strings-uwp-programming-in-c\/working-with-strings","title":{"rendered":"Working With Strings"},"content":{"rendered":"<h4>\n\tRead individual characters from a string<\/h4>\n<p>Treat the string as an array<\/p>\n<pre><code>\n\tstring MyString = \"abcd\";\n\tchar MyChar = MyString[2];\n<\/code><\/pre>\n<h4>\n\tGet Characters Between Markers Within String<\/h4>\n<pre><code>\n\tstring sTemp = responseStr;\n\tstring StartAfterChars;\n\tstring EndBeforeChars;\n\tint Start;\n\tint Length;\n\tstring FoundString;\n\n\tStartAfterChars = \"&lt;requestID&gt;\";\n\tEndBeforeChars = \"&lt;\/requestID&gt;\";\n\tStart = sTemp.IndexOf(StartAfterChars) + StartAfterChars.Length;\n\tLength = sTemp.IndexOf(EndBeforeChars) - Start;\n\tif ((Start &gt; 0) &amp;&amp; (Length &gt; 0))\n\t\tFoundString = sTemp.Substring(Start, Length);\n\telse\n\t\tFoundString = \"\";\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Read individual characters from a string Treat the string as an array string MyString = &#8220;abcd&#8221;; char MyChar = MyString[2]; Get Characters Between Markers Within String string sTemp = responseStr; string StartAfterChars; string EndBeforeChars; int Start; int Length; string FoundString; StartAfterChars = &#8220;&lt;requestID&gt;&#8221;; EndBeforeChars = &#8220;&lt;\/requestID&gt;&#8221;; Start = sTemp.IndexOf(StartAfterChars) + StartAfterChars.Length; Length = sTemp.IndexOf(EndBeforeChars) &#8211; [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[127],"tags":[],"class_list":["post-673","post","type-post","status-publish","format-standard","hentry","category-strings-uwp-programming-in-c"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts\/673","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/comments?post=673"}],"version-history":[{"count":1,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts\/673\/revisions"}],"predecessor-version":[{"id":1153,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts\/673\/revisions\/1153"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/media?parent=673"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/categories?post=673"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/tags?post=673"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}