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

com.brambolt.util.Strings Maven / Gradle / Ivy

There is a newer version: 2022.05.01-7057
Show newest version
package com.brambolt.util;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

@SuppressWarnings("unused")
public class Strings {

    public static List asList(String value) {
        return asList(value, ",");
    }

    public static List asList(String value, String delimiter) {
        return (null != value && !value.trim().isEmpty())
            ? Arrays.asList(value.split(delimiter))
            : new ArrayList<>(); // An empty list for an empty value
    }

    public static int maxLength(String[] strings) {
        int length = 0;
        for (String s: strings) {
            int current = s.length();
            if (current > length)
                length = current;
        }
        return length;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy