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 | 81044 |
18 | .jsbeautifyrc | 꿈돌이 | 2020.11.04 | 351 |
17 | QEMU 데비안 클라 구성 세트 | 꿈돌이 | 2021.03.25 | 114 |
16 | Voron v0 클리퍼 설정 | 꿈돌이 | 2021.03.29 | 180 |
15 | MS SQL Server Express 설치 | 꿈돌이 | 2021.08.20 | 122 |
14 | 확인용 | 꿈돌이 | 2021.08.30 | 84 |
13 | wsl 관련된 개체 종류에 대한 해당 작업은 지원되지 않습니다 | 꿈돌이 | 2021.11.01 | 1994 |
12 | sql server 애슬론 암호건 상태에서 안 될 경우 | 꿈돌이 | 2021.12.18 | 128 |
11 | 크롬 cmd switch | 꿈돌이 | 2022.05.07 | 76 |
10 | 해상도 fps 다른 동영상 합치기 | 꿈돌이 | 2022.05.09 | 231 |
9 | softether 연결 | 꿈돌이 | 2022.07.21 | 85 |
8 | scp 몰아서 보내기 | 꿈돌이 | 2022.07.21 | 80 |
7 | 윈도우 폴더명 파일명 소문자로 바꾸기 | 꿈돌이 | 2023.01.09 | 157 |
6 | GPU cloud | 꿈돌이 | 2023.03.26 | 49 |
5 | windows 11 ssh-keygen.exe directory | 꿈돌이 | 2023.03.29 | 156 |
4 | wsl 지정 경로에 수동 설치 | 꿈돌이 | 2023.05.28 | 136 |
3 | 윈도우에서 fstrim | 꿈돌이 | 2024.04.03 | 2 |
2 | 윈도우 키보드 입력 속도 조정 | 꿈돌이 | 2024.04.21 | 2 |
1 | 윈도우 터미널 색상, 글꼴 설정 | 꿈돌이 | 2024.04.24 | 2 |