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

gov.nasa.pds.harvest.util.PdsStringUtils Maven / Gradle / Ivy

package gov.nasa.pds.harvest.util;

/**
 * Helper methods to work with strings.
 * 
 * @author karpenko
 */
public class PdsStringUtils
{
    /**
     * Trim a string. Return null if the string is empty.
     * @param str a string
     * @return trimmed string
     */
    public static String trim(String str)
    {
        if(str == null) return null;
        str = str.trim();
        
        return str.isEmpty() ? null : str;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy