ToCharArray vs. String[i]
If I want to loop through the characters in a string, would it matter at all (as far as efficiency is concerned) whether I access the characters with brackets or if I convert the whole thing to a character array first and then access the characters?
ie:
string myStr = "MrPolite rules the world";
for (int i=0; i<myStr.Length; i++)
Console.WriteLine (myStr[i]);
vs.
string myStr = "MrPolite rules the world";
char[] chrs = myStr.ToCharArray();
for (int i=0; i<chrs.Length; i++)
Console.WriteLine (chrs[i]);
:afrog: