Back to project page u2020.
The source code is released under:
Apache License
If you think the Android project u2020 listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.jakewharton.u2020.util; // ww w . jav a 2 s. c o m public final class Strings { private Strings() { // No instances. } public static boolean isBlank(CharSequence string){ return (string == null || string.toString().trim().length() == 0); } public static String valueOrDefault(String string, String defaultString) { return isBlank(string) ? defaultString : string; } public static String truncateAt(String string, int length) { return string.length() > length ? string.substring(0, length) : string; } }