本文整理汇总了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