FastStringUtils is an easy-to-use zero dependency collection of very fast String utility functions for Java.
Add it as a maven dependency or just download the latest release.
<dependency>
<groupId>com.konloch</groupId>
<artifactId>FastStringUtils</artifactId>
<version>1.3.0</version>
</dependency>
This is a very small library and only contains a handful of functions.
By default, the Java String.split function is regex based, as a general rule, I avoid using it in all of my projects. Instead, I opt for using this library to replace that function.
//split the string using the space character as a separator
String[] simpleSplitExample = FastStringUtils.split("Split Example", " ");
//split the string using the space character as a separator, with a maximum search limit of 2
String[] limiterSplitExample = FastStringUtils.split("Split Example With A Limit ", " ", 2);
//split the string using the space character as a separator, with a maximum search limit of 2, and preserve the separator
String[] limiterSplitExamplePreseveSeparator = FastStringUtils.split("Split Example With A Limit ", " ", 2, true);
These functions are used to do fast non-strict checks to see if the string can represent specific types.
boolean isNull = FastStringUtils.isNull("null");
boolean isBoolean = FastStringUtils.isBoolean("false");
boolean isInteger = FastStringUtils.isInteger("1");
boolean isDouble = FastStringUtils.isDouble("1.0D");
boolean isFloat = FastStringUtils.isFloat("1.0F");