Skip to content

Instantly share code, notes, and snippets.

View qluana7's full-sized avatar
Never gonna give you up

Luana7 qluana7

Never gonna give you up
View GitHub Profile
@qluana7
qluana7 / EngToKo.cs
Last active February 20, 2022 05:18
한영타(gksdudxk)를 조합된 한글로 변환해주는 코드입니다.
using System;
using System.Linq;
namespace EnglishConvert
{
public class EngToKo
{
#region Const Values
const int FINAL = 28;
const int NEUTRAL = 21;
@qluana7
qluana7 / SpanArray.cs
Last active January 16, 2023 10:39
뒤와 앞이 연결된 배열입니다. 기존의 Array는 Length를 넘어가거나 음수를 넣으면 IndexOutOfRangeException를 던지지만, SpanArray는 그에 해당하는 값을 반환합니다. Ex) { 1, 2, 3, 4 }[5] = 2
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
namespace CustomArray
{
#region SpanArray<T>
public class SpanArray<T> : IEnumerable<T>
{
@qluana7
qluana7 / RecentCollection.cs
Last active July 5, 2021 02:12
특정 아이템을 맨 앞이나 맨 뒤로 보낼 수 있는 Collection입니다. Recent Files 같은 최근 시스템을 만들때 사용됩니다
public class RecentCollection<T> : ICollection<T>
{
public RecentCollection()
{
_collection = new List<T>();
}
public RecentCollection(int capacity)
{
_collection = new List<T>(capacity);
@qluana7
qluana7 / RandomString.cs
Last active August 13, 2021 16:11
랜덤 문자열을 얻을 수 있습니다.
using System;
using System.Linq;
[Flags]
public enum Options
{
Upper = 1,
Lower = 1 << 1,
Number = 1 << 2
}
@qluana7
qluana7 / CountDictionary.cs
Created March 2, 2022 07:46
Key 값의 갯수를 포함하는 간단한 Dictionary입니다.
public class CountDictionary<TKey> : IDictionary<TKey, int> where TKey : notnull
{
public CountDictionary()
{
Collections = new();
}
public CountDictionary(IEnumerable<KeyValuePair<TKey, int>> pair)
{
Collections = new(pair);
}