使用foreach语句的示例. [英] Example using the foreach statement.

查看:57
本文介绍了使用foreach语句的示例.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以提供一个清晰的示例来说明如何使用foreach语句吗?

Could somebody please provide a clear example that shows how to use the foreach statement?

推荐答案

foreach(Apostle prophet in God.Apostles)
{
    prophet.WriteScriptures();
}


尝试此链接:thumbsup:
http://msdn.microsoft.com/en-us/library/ttw7t8t6.aspx [ ^ ]
-Ambi-
try this link :thumbsup:
http://msdn.microsoft.com/en-us/library/ttw7t8t6.aspx[^]
-Ambi-


foreach的另一个示例是,

Another example of foreach is,

string[] stringArray = { "C#"," ","Framework 4.0" };
Array.ForEach(stringArray, item =>
{
    Console.WriteLine(item);
});



:)



:)


这篇关于使用foreach语句的示例.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆