LINQ

C# LINQ メモ

# 文字列のアスキーコードを取得の例
string str1 = "This is a pen";
string a1 = string.Join("-", System.Text.Encoding.ASCII.GetBytes(str1).Select(x => $"{x:X2}"));
string a2 = string.Join("-", str1.Select(x => $"{Convert.ToInt32(x):X2}"));