Class StringUtils

java.lang.Object
org.gradle.docs.internal.StringUtils

public class StringUtils extends Object
  • Constructor Details

    • StringUtils

      public StringUtils()
  • Method Details

    • capitalize

      public static String capitalize(String s)
      Capitalizes the first letter of the string. example to Example
      Parameters:
      s - the string
      Returns:
      transformed string
    • uncapitalize

      public static String uncapitalize(String s)
      Makes the first letter of the string lowercase. Example to example
      Parameters:
      s - the string
      Returns:
      transformed string
    • toTitleCase

      public static String toTitleCase(String s)
      Capitalizes every word in a string. this is an example to This Is An Example
      Parameters:
      s - the string
      Returns:
      transformed string
    • toLowerCamelCase

      public static String toLowerCamelCase(String s)
      Capitalizes every word in a string, removes all spaces and joins them together as one identifier. This is like a conventional Java identifier. this is an example to thisIsAnExample
      Parameters:
      s - the string
      Returns:
      transformed string
    • toSnakeCase

      public static String toSnakeCase(String s)
      Splits a string based on uppercase letters and rejoins them with underscores and makes the identifier lowercase. ThisIsAnExample to this_is_an_example
      Parameters:
      s - the string
      Returns:
      transformed string
    • toKebabCase

      public static String toKebabCase(String s)
      Like toSnakeCase(String), except separated by hyphens. ThisIsAnExample to This-is-an-example
      Parameters:
      s - the string
      Returns:
      transformed string