Package com.github.alexdlaird
Class StringUtils
java.lang.Object
com.github.alexdlaird.StringUtils
public class StringUtils
extends java.lang.Object
Convenience methods for String manipulation.
-
Constructor Summary
Constructors Constructor Description StringUtils()
-
Method Summary
Modifier and Type Method Description static boolean
isBlank(java.lang.CharSequence cs)
Check that a String contains text.static boolean
isNotBlank(java.lang.CharSequence cs)
Check that a String does not contain text.static java.lang.String
streamToString(java.io.InputStream inputStream, java.nio.charset.Charset charset)
Convert anInputStream
to a String.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
StringUtils
public StringUtils()
-
-
Method Details
-
streamToString
public static java.lang.String streamToString(java.io.InputStream inputStream, java.nio.charset.Charset charset) throws java.io.IOExceptionConvert anInputStream
to a String.- Parameters:
inputStream
- The Input Stream to read from.charset
- The charset of the Input Stream.- Returns:
- The resulting String.
- Throws:
java.io.IOException
- An I/O error has occurred.
-
isNotBlank
public static boolean isNotBlank(java.lang.CharSequence cs)Check that a String does not contain text.- Parameters:
cs
- The character sequence to check for text.- Returns:
- True if not blank, false otherwise.
-
isBlank
public static boolean isBlank(java.lang.CharSequence cs)Check that a String contains text.- Parameters:
cs
- The character sequence to check for text.- Returns:
- True if blank, false otherwise.
-