Skip to main content
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Strings.UCase Method
- Reference
Definition
Returns a string or character containing the specified string converted to uppercase.
In this article
Overloads
UCase[Char] | Returns a string or character containing the specified string converted to uppercase. |
UCase[String] | Returns a string or character containing the specified string converted to uppercase. |
UCase[Char]
Returns a string or character containing the specified string converted to uppercase.
Parameters
Value Char
Required. Any valid String or Char expression.
Returns
CharA string or character containing the specified string converted to uppercase.
Examples
This example uses the UCase function to return an uppercase version of a string.
' String to convert. Dim lowerCase As String = "Hello World 1234" ' Returns "HELLO WORLD 1234". Dim upperCase As String = UCase[lowerCase]Remarks
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.
See also
- LCase
- String Manipulation Summary
- Strings in Visual Basic
- Introduction to Strings in Visual Basic
Applies to
UCase[String]
Returns a string or character containing the specified string converted to uppercase.
Parameters
Value String
Required. Any valid String or Char expression.
Returns
StringA string or character containing the specified string converted to uppercase.
Examples
This example uses the UCase function to return an uppercase version of a string.
' String to convert. Dim lowerCase As String = "Hello World 1234" ' Returns "HELLO WORLD 1234". Dim upperCase As String = UCase[lowerCase]Remarks
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.
See also
- LCase
- String Manipulation Summary
- Strings in Visual Basic
- Introduction to Strings in Visual Basic
Applies to
Tip: See also the IDL_String::ToLower method, which provides similar functionality but with an object-oriented interface.
The STRLOWCASE function returns a copy of String converted to lowercase characters. Only uppercase characters are modified—lowercase and non-alphabetic characters are copied without change.
Examples
To convert the string “IDL is fun” to all lowercase characters and print the result, enter:
PRINT, STRLOWCASE['IDL is fun']IDL prints:
idl is funSyntax
Result = STRLOWCASE[String]
Return Value
Returns a string composed of lowercase characters.
Arguments
String
The string to be converted. If this argument is not a string, it is converted using IDL’s default formatting rules. If String is an array, the result is an array with the same structure—each element contains a lower case copy of the corresponding element of String.
Keywords
None.
Version History
Original | Introduced |
See Also
String Operations, String Processing, STRUPCASE, IDL_String
capitalize[] Returns the copy of the string with its first character capitalized and the rest of the letters are in lowercased. casefold[] Returns a lowered case string. It is similar to the lower[] method, but the casefold[] method converts more characters into lower case. center[] Returns a new centered string of the specified length, which is padded with the specified character. The deafult character is space. count[] Searches [case-sensitive] the specified substring in the given string and returns an integer indicating occurrences of the substring. endswith[] Returns True if a string ends with the specified suffix [case-sensitive], otherwise returns False. expandtabs[] Returns a string with all tab characters \t replaced with one or more space, depending on the number of characters before \t and the specified tab size. find[] Returns the index of the first occurence of a substring in the given string [case-sensitive]. If the substring is not found it returns -1. index[] Returns the index of the first occurence of a substring in the given string. isalnum[] Returns True if all characters in the string are alphanumeric [either alphabets or numbers]. If not, it returns False. isalpha[] Returns True if all characters in a string are alphabetic [both lowercase and uppercase] and returns False if at least one character is not an alphabet. isascii[] Returns True if the string is empty or all characters in the string are ASCII. isdecimal[] Returns True if all characters in a string are decimal characters. If not, it returns False. isdigit[] Returns True if all characters in a string are digits or Unicode char of a digit. If not, it returns False. isidentifier[] Checks whether a string is valid identifier string or not. It returns True if the string is a valid identifier otherwise returns False. islower[] Checks whether all the characters of a given string are lowercased or not. It returns True if all characters are lowercased and False even if one character is uppercase. isnumeric[] Checks whether all the characters of the string are numeric characters or not. It will return True if all characters are numeric and will return False even if one character is non-numeric. isprintable[] Returns True if all the characters of the given string are Printable. It returns False even if one character is Non-Printable. isspace[] Returns True if all the characters of the given string are whitespaces. It returns False even if one character is not whitespace. istitle[] Checks whether each word's first character is upper case and the rest are in lower case or not. It returns True if a string is titlecased; otherwise, it returns False. The symbols and numbers are ignored. isupper[] Returns True if all characters are uppercase and False even if one character is not in uppercase. join[] Returns a string, which is the concatenation of the string [on which it is called] with the string elements of the specified iterable as an argument. ljust[] Returns the left justified string with the specified width. If the specified width is more than the string length, then the string's remaining part is filled with the specified fillchar. lower[] Returns the copy of the original string wherein all the characters are converted to lowercase. lstrip[] Returns a copy of the string by removing leading characters specified as an argument. maketrans[] Returns a mapping table that maps each character in the given string to the character in the second string at the same position. This mapping table is used with the translate[] method, which will replace characters as per the mapping table. partition[] Splits the string at the first occurrence of the specified string separator sep argument and returns a tuple containing three elements, the part before the separator, the separator itself, and the part after the separator. replace[] Returns a copy of the string where all occurrences of a substring are replaced with another substring. rfind[] Returns the highest index of the specified substring [the last occurrence of the substring] in the given string. rindex[] Returns the index of the last occurence of a substring in the given string. rjust[] Returns the right justified string with the specified width. If the specified width is more than the string length, then the string's remaining part is filled with the specified fill char. rpartition[] Splits the string at the last occurrence of the specified string separator sep argument and returns a tuple containing three elements, the part before the separator, the separator itself, and the part after the separator. rsplit[] Splits a string from the specified separator and returns a list object with string elements. rstrip[] Returns a copy of the string by removing the trailing characters specified as argument. split[] Splits the string from the specified separator and returns a list object with string elements. splitlines[] Splits the string at line boundaries and returns a list of lines in the string. startswith[] Returns True if a string starts with the specified prefix. If not, it returns False. strip[] Returns a copy of the string by removing both the leading and the trailing characters. swapcase[] Returns a copy of the string with uppercase characters converted to lowercase and vice versa. Symbols and letters are ignored. title[] Returns a string where each word starts with an uppercase character, and the remaining characters are lowercase. translate[] Returns a string where each character is mapped to its corresponding character in the translation table. upper[] Returns a string in the upper case. Symbols and numbers remain unaffected. zfill[] Returns a copy of the string with '0' characters padded to the left. It adds zeros [0] at the beginning of the string until the length of a string equals the specified width parameter.