For example, is it possible to use a foreach statement to perform an action for each string in a class?
foreach (string s in <class>)
like I can use it with AppSettings?
foreach (string key in ConfigurationManager.AppSettings)
If it isn’t possible, is there any other similar way to do so?
You can use the namespaces
System.ReflectionandSystem.Linq