The variable is: Hello The result I want:
split[0] = he;
split[1] = ll;
split[2] = o + ( space );
I tried this code:
string[] split = new string[text.Length / 2 + (text.Length % 2 == 0 ? 0 : 1)];
for (int i = 0; i < split.Length; i++)
{
split[i] = text.Substring(i, i + 2 > text.Length ? 1 : 2);
}
The output is "He el lo" (it doubles the second character).