Files
freeCodeCamp/guide/chinese/csharp/continue/index.md
2018-10-16 21:32:40 +05:30

31 lines
545 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: Continue statement
localeTitle: 继续声明
---
# 继续声明
`continue`语句将控制传递给循环内的下一个迭代。
在此示例中当i的值为2时将跳过循环中的下一个语句。
## 例
```
int[] array = { 1, 2, 3, 4, 5 };
for (int i = 0; i < array.Length; i++)
{
if( i == 2)
{
continue;
}
Console.WriteLine("Item on index {0} is {1}", i, array[i]);
}
```
## 输出:
```
> Item on index 0 is 1
> Item on index 1 is 2
> Item on index 3 is 4
> Item on index 4 is 5
```