Convert Char[] Array To String

	char[] MyCharArray = new char[3];
	MyCharArray[0] = 'a';
	MyCharArray[1] = 'b';
	MyCharArray[2] = 'c';
	ReturnString = new string(MyCharArray);	//Note do not add a terminating null, if you do it will be present as a 0x00 character at the end of the string! 

Convert Char To Character Value

	char MyChar = 'A';
	int MyInt = Convert.ToInt32(MyChar); 
	MyInt = MyInt - Convert.ToInt32('A');

or

	char MyChar = 'A';
	int MyInt = Convert.ToInt32(MyChar - 'A'); 

For each char in a string

	foreach (char NextCharacter in MyString)
	{
Feel free to comment if you can add help to this page or point out issues and solutions you have found. I do not provide support on this site, if you need help with a problem head over to stack overflow.

Comments

Your email address will not be published. Required fields are marked *