Check out example codes for "c# iterate over string". It will help you in understanding the concepts better.

Code Example 1

// Regular Strings
string foo = "hello world", bar = string.Empty;

foreach(char c in foo){
    bar += c;
}

// StringBuilder
string foo = "hello world";
StringBuilder bar = new StringBuilder();

foreach (char c in foo)
{
    bar.Append(c);
}

Learn ReactJs, React Native from akashmittal.com