Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio 2008
Visual Studio
Visual Basic
S-Z Functions
 UCase Function
Collapse All/Expand All Collapse All
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
Visual Basic Language Reference
UCase Function (Visual Basic)

Returns a string or character containing the specified string converted to uppercase.

Public Shared Function UCase(ByVal Value As Char) As Char
' -or-
Public Shared Function UCase(ByVal Value As String) As String
Value

Required. Any valid String or Char expression.

Only lowercase letters are converted to uppercase; all uppercase letters and nonletter characters remain unchanged.

This function uses the application's culture information when manipulating the string so that the case changes are appropriate for the locale in which the application is being used.

Security noteSecurity Note:

If your application makes security decisions based on the result of a comparison or case-change operation, then the operation should use the String..::.Compare method, and pass Ordinal or OrdinalIgnoreCase for the comparisonType argument. For more information, see How Culture Affects Strings in Visual Basic.

This example uses the UCase function to return an uppercase version of a string.

Visual Basic
' String to convert.
Dim LowerCase As String = "Hello World 1234"
' Returns "HELLO WORLD 1234".
Dim UpperCase As String = UCase(LowerCase)

Namespace: Microsoft.VisualBasic

Module: Strings

Assembly: Visual Basic Runtime Library (in Microsoft.VisualBasic.dll)

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement | Site Feedback
Page view tracker