[VB.NET]文字列を大文字から小文字に変換する

2021年9月29日

構文
1.文字列.ToLower
Public Function ToLower () As String
この文字列のコピーを小文字に変換して返します。

2.文字列.ToUpper
Public Function ToUpper () As String
この文字列のコピーを大文字に変換して返します。
使用例

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
Module Module1
Sub Main()
'String型変数の宣言
Dim strA As String = "STudy"
'大文字を小文字へ変換
Dim res As String = strA.ToLower
Console.WriteLine("大文字->小文字: " + res)
'小文字を大文字へ変換
Dim res2 As String = strA.ToUpper
Console.WriteLine("小文字->大文字: " + res2)
Console.ReadKey()
End Sub
End Module
Module Module1 Sub Main() 'String型変数の宣言 Dim strA As String = "STudy" '大文字を小文字へ変換 Dim res As String = strA.ToLower Console.WriteLine("大文字->小文字: " + res) '小文字を大文字へ変換 Dim res2 As String = strA.ToUpper Console.WriteLine("小文字->大文字: " + res2) Console.ReadKey() End Sub End Module
Module Module1

    Sub Main()

        'String型変数の宣言
        Dim strA As String = "STudy"
        '大文字を小文字へ変換
        Dim res As String = strA.ToLower
        Console.WriteLine("大文字->小文字: " + res)

        '小文字を大文字へ変換
        Dim res2 As String = strA.ToUpper
        Console.WriteLine("小文字->大文字: " + res2)


        Console.ReadKey()
    End Sub


End Module

結果
大文字->小文字: study
小文字->大文字: STUDY

VB.net

Posted by arkgame