loop to check a string for a character in 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);
}