C# Dictionary
2015.08.28 13:53
배열 대신 사전.
using System;
using System.Collections.Generic;namespace Dictionary_array_alt
{
class Program
{
static void Main(string[] args)
{
// 인덱스는 스트링, 데이터는 배열
var var1_dic = new Dictionary<string, string[]>();var1_dic.Add("idx1", new string[] { "1st string", "2nd string" });
var1_dic.Add("idx2", new string[] { "3rd string", "4th string" });foreach (KeyValuePair<string, string[]> each_value in var1_dic)
{
Console.Write("Array: "+each_value);
Console.Write("\r\n");
Console.Write(" / Index: " + each_value.Key);
Console.Write(" / Value: " + each_value.Value[0]);
Console.Write(" / Value: " + each_value.Value[1]);
Console.Write("\r\n");
}Console.WriteLine("Press Enter key to close.");
Console.ReadLine(); // Pause
}
}
}
댓글 0
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
공지 | 툴 북마크 | 꿈돌이 | 2021.02.11 | 80965 |
19 | 거미줄 테스트 | 꿈돌이 | 2020.03.28 | 191 |
18 | Voron v0 클리퍼 설정 | 꿈돌이 | 2021.03.29 | 180 |
17 | Cura, PrusaSlicer (Slic3r) 포터블 | 꿈돌이 | 2019.12.25 | 172 |
16 | 브라우저 설정 - HTML5 그리드 | 꿈돌이 | 2015.08.25 | 168 |
15 | 윈도우 폴더명 파일명 소문자로 바꾸기 | 꿈돌이 | 2023.01.09 | 150 |
14 | windows 11 ssh-keygen.exe directory | 꿈돌이 | 2023.03.29 | 145 |
13 | wsl 지정 경로에 수동 설치 | 꿈돌이 | 2023.05.28 | 132 |
12 | sql server 애슬론 암호건 상태에서 안 될 경우 | 꿈돌이 | 2021.12.18 | 128 |
11 | MS SQL Server Express 설치 | 꿈돌이 | 2021.08.20 | 122 |
10 | Git 사용자 설정 | 꿈돌이 | 2017.03.18 | 120 |
9 | QEMU 데비안 클라 구성 세트 | 꿈돌이 | 2021.03.25 | 114 |
8 | softether 연결 | 꿈돌이 | 2022.07.21 | 85 |
7 | 확인용 | 꿈돌이 | 2021.08.30 | 84 |
6 | scp 몰아서 보내기 | 꿈돌이 | 2022.07.21 | 80 |
5 | 크롬 cmd switch | 꿈돌이 | 2022.05.07 | 76 |
4 | GPU cloud | 꿈돌이 | 2023.03.26 | 47 |
3 | 윈도우에서 fstrim | 꿈돌이 | 2024.04.03 | 1 |
2 | 윈도우 터미널 색상, 글꼴 설정 | 꿈돌이 | 2024.04.24 | 0 |
1 | 윈도우 키보드 입력 속도 조정 | 꿈돌이 | 2024.04.21 | 0 |