{"id":276,"date":"2016-12-16T22:50:48","date_gmt":"2016-12-16T22:50:48","guid":{"rendered":"https:\/\/ibex.tech\/windows-iot\/?p=276"},"modified":"2016-12-16T22:50:48","modified_gmt":"2016-12-16T22:50:48","slug":"convert-char","status":"publish","type":"post","link":"https:\/\/ibex.tech\/csharp\/c-sharp\/strings\/convert-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[] MyCharArray = new char[3];\n\tMyCharArray[0] = 'a';\n\tMyCharArray[1] = 'b';\n\tMyCharArray[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":[9],"tags":[],"class_list":["post-276","post","type-post","status-publish","format-standard","hentry","category-strings"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts\/276","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=276"}],"version-history":[{"count":0,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts\/276\/revisions"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/media?parent=276"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/categories?post=276"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/tags?post=276"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}