I have a large 2D jagged edge array
string[][] MagicString = new string[417][];
MagicString[0] = new string[] { "Winner", "\u0041", "\u0042", "\u0043"};
//and so on only show first item in 2D here.
The strings are \u to make them Unicode value. I have them as Unicode as we move through the Array we can get Characters from outside the ASCII range. I also uses these values to display the Magic string in a different tab. In the case above we see A in a cell then B in next cell and then C etc. All this Unicode strings works fine.
string[] InnerCharArray = MagicString[cmbobx_sounds.SelectedIndex];
..
..
dataGridView1[grid_y, grid_x].Value = InnerCharArray[char_num];
Now the bit I cannot get to work. In a different tab the user inputs a character and we check through the arrays to find it then print out the first item which may say "Winner"
In the string below called Unicodevalue for input of A I cannot get it to be \u0041. It will always return double slash but I only want one slash \ \u0041. How can I read the text from the RichTextBox and turn it into a string \u0041, same as I have in the Array above?
for (int i = 0; i < rchtxbx_input.Text.Length; i++)
{
string UnicodeValue = @"\u" + String.Format("{0:x4}", Convert.ToInt32(rchtxbx_input.Text[i]));
//tried "\\u" @"\u" just u removed u altogether
for (int j = 0; j < MagicString.Length; j++)
{
string[] InnerCharArray = MagicString[j];
bool has = InnerCharArray.Contains(UnicodeValue);
/never goes true even when I type in A which is 0041 as in Array
if (has) rchtxbx_output.AppendText(InnerCharArray[0]);
}
}