SkipWhile with condition : SkipWhile « LINQ « C# / CSharp Tutorial






using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

public class MainClass{
public static void Main() {

            int[] numbers = { 5, 4, 1, 3, 9, 8, 6, 7, 2, 0 };
            
            var allButFirst3Numbers = numbers.SkipWhile(n => n % 3 != 0);
            
            Console.WriteLine("All elements starting from first element divisible by 3:");
            foreach (var n in allButFirst3Numbers) {
                Console.WriteLine(n);
            }
        }
}








22.69.SkipWhile
22.69.1.Use SkipWhile with index
22.69.2.SkipWhile with condition
22.69.3.SkipWhile with index
22.69.4.SkipWhile Prototype
22.69.5.Second SkipWhile Prototype