Skip to content

StringUtils.chop

Signature: StringUtils.chop(inputString)

Returns: String result - the chopped string, or null if inputString is null

Removes the last character from inputString, handling null by returning null.

Parameters

Type Name Description Default
String inputString the String to be chopped, may be null

Example

StringUtils.chop("¯\_(ツ)_/¯"); // ¯\_(ツ)_/ (last char removed)