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

graphql.util.StringKit Maven / Gradle / Ivy

There is a newer version: 230521-nf-execution
Show newest version
package graphql.util;

import java.util.Locale;

public class StringKit {

    public static String capitalize(String s) {
        if (s != null && !s.isEmpty()) {
            StringBuilder sb = new StringBuilder();
            // see https://github.com/graphql-java/graphql-java/issues/3385
            sb.append(s.substring(0, 1).toUpperCase(Locale.ROOT));
            if (s.length() > 1) {
                sb.append(s.substring(1));
            }
            return sb.toString();
        }
        return s;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy