본문 바로가기

프로그래밍/C#24

[C#] Dictionary ponyozzang.tistory.com/325 2021. 3. 17.
[C#] 전역변수 thebook.io/006890/part02/ch19/12/ C# 교과서: 19.12 함수 범위: 전역 변수와 지역 변수 thebook.io 링크는 공유가 가능하다고 해서 올립니다. 우리가 흔히 생각하는 전역변수가 C#에서는 필드라고 불린다고 하고, 전역 변수는 언더스코어(_) 또는 m_ 접두사를 붙이는 경향이 있다고 합니다. onlyican.tistory.com/99 2021. 3. 17.
[C#] 문자열이 모두 숫자인지 아닌지 판별. isdigit를 이용함 public static class StringExtension { /// /// True if all characters in a string is IsDigit(true), False if not /// /// /// public static bool IsNumber(this string me) { foreach (char ch in me) { if (!Char.IsDigit(ch)) return false; } return true; } } Sting Class의 확장 함수이다. 번호가 한개라도 섞여있으면 False가 리턴된다. private void Form1_Load(object sender, EventArgs e) { string a = "1000"; string b = "hi"; string.. 2021. 3. 17.
[C#] Hash를 간단하게 사용해보자 c#은 너무나도 코딩하기 편하게 list, hash, dictionary를 만들어놓았다. 사용하기가 너무 편하다. 근데 링크드 리스트도 쓸 수 있나? 하여튼 이번에는 Hash를 알아볼 것이다. 사용법은 list와 거의 동일하다. using System.Collections 우선 이걸 추가해주어야한다. using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace test { public partial class Form1 : Form { .. 2021. 3. 16.
[C#] List를 간단하게 사용해보자 loadofprogrammer.tistory.com/145 ★ 16. C# - List 사용 예제 List 에 대한 간략한 설명 및 사용 방법을 알아보겠습니다. [1] 일반적으로 배열은 동적으로 크기 조절이 되지 않지만 List는 가능합니다. [2] 리스트를 사용하면 배열의 크기에 대해서 크게 신경쓸 loadofprogrammer.tistory.com using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.W.. 2021. 3. 16.
[C#] ListBox를 사용해보자 (추가,삭제,Clear) 요렇게 만들어보자 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using System.IO; namespace test { public partial class Form1 : Form { private void Form1_Load(object sender, EventArgs e) { } public Form1() { InitializeComponent(); } privat.. 2021. 3. 16.