java.lang.Object
ushiosan.jvm_utilities.lang.Strings

public final class Strings extends Object
Class with utilities for handling text strings
  • Method Details

    • validate

      public static void validate(@Nullable @Nullable String content, @NotNull Apply.Empty<String> action)
      Check if the string is valid. This method verifies that the text is not null or that the content is an empty string.
      Parameters:
      content - the content you want to verify
      action - the action that is executed if the content is valid
    • validateC

      public static void validateC(@Nullable @Nullable CharSequence content, @NotNull Apply.Empty<CharSequence> action)
      Check if the string is valid. This method verifies that the text is not null or that the content is an empty string.
      Parameters:
      content - the content you want to verify
      action - the action that is executed if the content is valid
    • capitalize

      @NotNull public static @NotNull String capitalize(@NotNull @NotNull CharSequence content, boolean all)
      Transforms the text string and converts each word start to an uppercase letter
      Parameters:
      content - the content to convert
      all - option used to convert all words or only the first word of the entire content
      Returns:
      the converted content
    • capitalize

      @NotNull public static @NotNull String capitalize(@NotNull @NotNull CharSequence content)
      Transforms the text string and converts each word start to an uppercase letter
      Parameters:
      content - the content to convert
      Returns:
      the converted content
    • capitalizeWord

      @NotNull public static @NotNull String capitalizeWord(@NotNull @NotNull CharSequence content)
      Change the first letter of the word to a capital letter.

      This method cleans the content of spaces and only converts to a word and not a complete content.

      Parameters:
      content - the content to convert
      Returns:
      the converted content