From 495e38612160ac373325543de3c5b88e0ef6ed35 Mon Sep 17 00:00:00 2001 From: Laoujin Date: Sat, 31 Jan 2015 21:40:21 +0100 Subject: [PATCH] [CSharp/en]break and continue in loops --- csharp.html.markdown | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/csharp.html.markdown b/csharp.html.markdown index 88c2db35..9f66b8ff 100644 --- a/csharp.html.markdown +++ b/csharp.html.markdown @@ -244,8 +244,15 @@ on a new line! ""Wow!"", the masses cried"; int fooDoWhile = 0; do { - //Iterated 100 times, fooDoWhile 0->99 + // Start iteration 100 times, fooDoWhile 0->99 + if (false) + continue; // skip the current iteration + fooDoWhile++; + + if (fooDoWhile == 50) + break; // breaks from the loop completely + } while (fooDoWhile < 100); //for loop structure => for(; ; ) @@ -303,7 +310,7 @@ on a new line! ""Wow!"", the masses cried"; // Converting data // Convert String To Integer - // this will throw an Exception on failure + // this will throw a Exception on failure int.Parse("123");//returns an integer version of "123" // try parse will default to type default on failure