Skip to content

StringUtils.startsWithIgnoreCase

Signature: StringUtils.startsWithIgnoreCase(inputString, prefix)

Returns: Boolean result - true if the inputString starts with the prefix, case insensitive, 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 insensitive.

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.startsWithIgnoreCase("apple.txt", "APP"); //true