StringUtils upperCase

By | April 22, 2020

StringUtils upperCase method converts a string to uppercase.


str the String to upper case, may be null


the upper cased String, null if null String input

StringUtils uppercase Examples:

Below are the methods provided in StringUtils class and these are all null safe.

Equals/Compare: It compares whether two given strings are equal or not.
EqualsAny: Compares if the first string is equal to the given searchStrings.
IsEmpty/IsBlank: checks if a String contains text
Trim/Strip: removes leading and trailing whitespace from string.
startsWith: check if a String starts with a prefix / specified characters
endsWith: check if a String ends with a suffix / specified characters.
UpperCase/LowerCase/SwapCase/Capitalize/Uncapitalize: Used to change the case of a String
IndexOf/LastIndexOf/Contains: checks the index of string
IndexOfAny/LastIndexOfAny/IndexOfAnyBut/LastIndexOfAnyBut: Checks the index of given Strings
ContainsOnly/ContainsNone/ContainsAny: does String contains only/none/any of these characters
IsAlpha/IsNumeric/IsWhitespace/IsAsciiPrintable: checks the characters in a String

Reverse/ReverseDelimited: It reverses a String
Substring/Left/Right/Mid: It extracts substrings
SubstringBefore/SubstringAfter/SubstringBetween: substring extraction relative to other strings
Split/Join: Splits a String into an array of substrings and vice versa
Remove/Delete: It removes part of a String
Replace/Overlay: Searches a String and replaces one String with another
LeftPad/RightPad/Center/Repeat: It adds padding to a String


Recommended Posts:

All StringUtils methods with examples

Get last 4 chars from String

Convert String to String array

SQL quick reference for interview preparation

Source: Apache

Leave a Reply

Your email address will not be published. Required fields are marked *