[C#] Linq Object Sample > C#/.Net/Blazor/IIS

본문 바로가기
사이트 내 전체검색

C#/.Net/Blazor/IIS

[C#] Linq Object Sample

페이지 정보

작성자 sbLAB 댓글 0건 조회 4,614회 작성일 18-07-25 17:45

본문


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
 
            ex1();
        }
 
 
        public static void ex1()
        {
 
            string[] tools = { "Tablesaw", "Bandsaw", "Planer", "Jointer", "Drill", "Sander" };
            int[] count = { 17, 22, 13, 4, 5, 9 };
 
 
            //tools
            var list_tools = from t in tools
                             where t.Contains("a")
                             orderby t descending
                             select t;
 
            foreach (string s in list_tools)
            {
                Console.Write(s + "\n");
            }
 
            Console.Write("-------------------------\n");
 
 
            //count
            var list_count = from t in count
                             where t > 10
                             orderby t ascending
                             select t;
 
            foreach (int c in list_count)
            {
                Console.Write(c + "\n");
            }
 
 
        }
 
    }
}

댓글목록

등록된 댓글이 없습니다.

회원로그인

접속자집계

오늘
474
어제
396
최대
1,279
전체
222,524

그누보드5
Copyright © sebom.com All rights reserved.