提取循环中包含continue的语句封装成方法时间:2023-03-09 17:15:06 demo如下: private void button1_Click(object sender, EventArgs e) { for(int i=;i<;i++) { if (!a(i)) { continue; } this.label1.Text += i.ToString()+"、"; } } public bool a(int i) { if (i == ) { return false; } else { return true; } }