Reputation: 1657
I have a string array as shown below: How do I write each one of them to the console? Below is the code from my c# program: From the below code I have to write all the cats to the console
using (RegistryKey ic = clsidKey.OpenSubKey("Implemented Categories"))
{
string[] cats = ic.GetSubKeyNames();
}
Upvotes: 0
Views: 491
Reputation: 2078
Or even more specifically:
foreach(string cat in cats)
{
Console.Out.WriteLine(cat);
}
Upvotes: 0
Reputation: 128317
Don't you just do this?
foreach (string cat in cats) {
Console.WriteLine(cat);
}
Upvotes: 7
Reputation: 26190
Try this:
foreach(string cat in cats)
{
Console.WriteLine(cat);
}
Upvotes: 3