All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.megatronking.svg.generator.utils.TextUtils Maven / Gradle / Ivy

package com.github.megatronking.svg.generator.utils;

public class TextUtils {

    /**
     * Returns true if the string is null or 0-length.
     * @param str the string to be examined
     * @return true if str is null or zero length
     */
    public static boolean isEmpty(CharSequence str) {
        return str == null || str.length() == 0;
    }

    public static String removeMultiSpace(String text) {
        while (text != null && text.contains("  ")) {
            text = text.replaceAll("  ", " ");
        }
        return text;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy