java.lang.Object
ushiosan.jvm_utilities.lang.Strings
Class with utilities for handling text strings
-
Method Summary
Modifier and TypeMethodDescriptioncapitalize(@NotNull CharSequence content) Transforms the text string and converts each word start to an uppercase lettercapitalize(@NotNull CharSequence content, boolean all) Transforms the text string and converts each word start to an uppercase lettercapitalizeWord(@NotNull CharSequence content) Change the first letter of the word to a capital letter.static voidCheck if the string is valid.static voidvalidateC(@Nullable CharSequence content, @NotNull Apply.Empty<CharSequence> action) Check if the string is valid.
-
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 verifyaction- 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 verifyaction- 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 convertall- option used to convert all words or only the first word of the entire content- Returns:
- the converted content
-
capitalize
Transforms the text string and converts each word start to an uppercase letter- Parameters:
content- the content to convert- Returns:
- the converted content
-
capitalizeWord
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
-