UCase Function

UCase( string )

Returns a copy of string in which all lowercase characters have been converted to uppercase.

Example:

' This example uses the LTrim and RTrim functions to strip leading and

' trailing spaces, respectively, from a string variable.  It  uses the

' Trim function alone to strip both types of spaces.

' LCase and UCase are also shown in this example as well as the use

' of nested function calls

 

Sub Main

   MyString = "  <-Trim->  "   ' Initialize string.

   TrimString = LTrim(MyString)   ' TrimString = "<-Trim->  ".

   MsgBox "|" & TrimString & "|"

   TrimString = LCase(RTrim(MyString))   ' TrimString = "  <-trim->".

   MsgBox "|" & TrimString & "|"

   TrimString = LTrim(RTrim(MyString))   ' TrimString = "<-Trim->".

   MsgBox "|" & TrimString & "|"

   ' Using the Trim function alone achieves the same result.

   TrimString = UCase(Trim(MyString))   ' TrimString = "<-TRIM->".

   MsgBox "|" & TrimString & "|"

End Sub

 


Related Topics:

LCase Function