文字列 (String) いろいろ

        Dim Str As String = "QWERTY12345456asdfghZXcvBNM"
        Dim Str2 As String = "25"
        Dim Str3 As String = "AA(B),CC(D),EE(F)"

        '左端の1文字を取得
        Console.WriteLine(Str.Substring(0, 1)) 'Q

        '左から3番目の文字から5文字を取得
        Console.WriteLine(Str.Substring(2, 5)) 'ERTY1

        '右端の1文字を取得
        Console.WriteLine(Str.Substring(Str.Length - 1))  'M

        '右端の3文字を取得
        Console.WriteLine(Str.Substring(Str.Length - 3, 3))  'BNM

        '位置の取得
        Console.WriteLine(Str.IndexOf("a")) '有れば文字の位置「14」、無ければ「-1」

        '右詰めして文字数を合わせる
        Console.WriteLine("a" & Str2.PadLeft(5, "0"))   'a00025

        '置換
        Console.WriteLine(Str.Replace("RTY1", "aaa"))  'QWEaaa2345456asdfghZXcvBNM

        '分割
        Dim Strs() As String
        Strs = Str3.Split(",")
        Console.WriteLine(UBound(Strs))   '2
        Console.WriteLine(Strs(0)) 'AA(B)
        Console.WriteLine(Strs(1)) 'CC(D)
        Console.WriteLine(Str3.Split(",")(2)) 'EE(F)