Skip to content

StringUtils.startsWith

Signature: StringUtils.startsWith(inputString, prefix)

Returns: Boolean result - true if the inputString starts with the prefix, case sensitive, or both null

Check if the inputString starts with a specified prefix. nulls are handled without exceptions. Two null references are considered to be equal. The comparison is case sensitive.

Parameters

Type Name Description Default
String inputString the String to check, may be null
String prefix the prefix to find, may be null

Example

StringUtils.startsWith("232882339.txt", "23"); // true