{"id":391,"date":"2019-06-20T13:06:44","date_gmt":"2019-06-20T12:06:44","guid":{"rendered":"https:\/\/ibex.tech\/csharp\/?p=391"},"modified":"2022-09-13T14:50:16","modified_gmt":"2022-09-13T13:50:16","slug":"string-char","status":"publish","type":"post","link":"https:\/\/ibex.tech\/csharp\/uwp-programming-in-c\/strings-uwp-programming-in-c\/string-char","title":{"rendered":"String char"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">Convert Char[] Array To String<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>\tchar&#91;] MyCharArray = new char&#91;3];\n\tMyCharArray&#91;0] = 'a';\n\tMyCharArray&#91;1] = 'b';\n\tMyCharArray&#91;2] = 'c';\n\tReturnString = new string(MyCharArray);\t\/\/Note do not add a terminating null, if you do it will be present as a 0x00 character at the end of the string! <\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Convert Char To Character Value<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>\tchar MyChar = 'A';\n\tint MyInt = Convert.ToInt32(MyChar); \n\tMyInt = MyInt - Convert.ToInt32('A');<\/code><\/pre>\n\n\n\n<p>or<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\tchar MyChar = 'A';\n\tint MyInt = Convert.ToInt32(MyChar - 'A'); <\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">For each char in a string<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>\tforeach (char NextCharacter in MyString)\n\t{<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Convert Char[] Array To String Convert Char To Character Value or For each char in a string<\/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-391","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\/391","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=391"}],"version-history":[{"count":3,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts\/391\/revisions"}],"predecessor-version":[{"id":1154,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts\/391\/revisions\/1154"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/media?parent=391"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/categories?post=391"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/tags?post=391"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}