学习foreach
来源:互联网 发布:公司财务战略矩阵 编辑:程序博客网 时间:2024/05/01 16:08
using System;
public class Foreach1
...{
static void Main()
...{
int [] values=...{5,6,7,8};
foreach (int i in values)
Console.WriteLine("the number is {0}",i);
//Console.WriteLine("the number is {0}",values[i]);注意两者的不同
string myString="this is a string";
char[] myChars=myString.ToCharArray();
foreach (char character in myString)
...{
Console.Write("{0} ",character);
}
Console.WriteLine();
char[] separator=...{' '};
string[] myWords;
myWords=myString.Split(separator);
foreach (string word in myWords)
...{
Console.Write("{0},",word);
}
}
}
D:Projecthanding>Foreach1
the number is 5
the number is 6
the number is 7
the number is 8
t h i s i s a s t r i n g
this,is,a,string,
public class Foreach1
...{
static void Main()
...{
int [] values=...{5,6,7,8};
foreach (int i in values)
Console.WriteLine("the number is {0}",i);
//Console.WriteLine("the number is {0}",values[i]);注意两者的不同
string myString="this is a string";
char[] myChars=myString.ToCharArray();
foreach (char character in myString)
...{
Console.Write("{0} ",character);
}
Console.WriteLine();
char[] separator=...{' '};
string[] myWords;
myWords=myString.Split(separator);
foreach (string word in myWords)
...{
Console.Write("{0},",word);
}
}
}
D:Projecthanding>Foreach1
the number is 5
the number is 6
the number is 7
the number is 8
t h i s i s a s t r i n g
this,is,a,string,
- 学习foreach
- jstl <c:forEach> 学习
- C#学习之Foreach
- MyBatis学习八:foreach
- Boost程序库学习-foreach
- jstl学习记录 -- forEach
- jmeter ForEach Controller学习
- 学习笔记:自定义标签 foreach
- 【Makefile】学习if wildcard foreach
- 阿里巴巴Java规约学习-foreach
- java学习之Enumeration foreach
- C#学习笔记7-foreach
- foreach与&引用的学习
- foreach
- foreach
- foreach
- foreach
- Foreach
- sql server2005相关资源
- vs2005水晶报表问题
- 合作研发真的那么难?
- 智能指针单例模式的实现
- 慎用Enum的ToString
- 学习foreach
- Dreamweaver制作网页经典问题大整理
- 20070929听力原文
- Linux IPC备忘
- 字符,字节和编码
- DataGrid自定义导航按钮
- ASP.NET网络应用与开发实践教程 - 图书目录
- SQL Server 2005的30个最重要特点
- Office文档在线编辑的实现之一