iterate over each character in string C# code example
Example: c# iterate over string
// 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);
}