本文整理匯總了VB.NET中System.Char.ToUpper方法的典型用法代碼示例。如果您正苦於以下問題:VB.NET Char.ToUpper方法的具體用法?VB.NET Char.ToUpper怎麽用?VB.NET Char.ToUpper使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Char
的用法示例。
在下文中一共展示了Char.ToUpper方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: Example
' 導入命名空間
Imports System.Globalization
Module Example
Public Sub Main()
Dim cultures() As CultureInfo = { CultureInfo.CreateSpecificCulture("en-US"),
CultureInfo.InvariantCulture,
CultureInfo.CreateSpecificCulture("tr-TR") }
Dim chars() As Char = {"ä"c, "e"c, "E"c, "i"c, "I"c }
Console.WriteLine("Character en-US Invariant tr-TR")
For Each ch In chars
Console.Write(" {0}", ch)
For Each culture In cultures
Console.Write("{0,12}", Char.ToUpper(ch, culture))
Next
Console.WriteLine()
Next
End Sub
End Module
輸出:
Character en-US Invariant tr-TR ä Ä Ä Ä e E E E E E E E i I I İ I I I I
示例2: Example
Module Example
Public Sub Main()
Dim chars() As Char = { "e"c, "E"c, "6"c, ","c, "ж"c, "ä"c }
For Each ch In chars
Console.WriteLine("{0} --> {1} {2}", ch, Char.ToUpper(ch),
If(ch = Char.ToUpper(ch), "(Same Character)", ""))
Next
End Sub
End Module
輸出:
e --> E E --> E (Same Character) 6 --> 6 (Same Character) , --> , (Same Character) ж --> Ж ä --> Ä
示例3: MainClass
' 導入命名空間
Imports System
Public Class MainClass
Shared Sub Main()
Console.WriteLine("to upper case: " & Char.ToUpper("aaa") )
End Sub ' Main
End Class