-
- All Implemented Interfaces:
public final class StringsKt
-
-
Field Summary
Fields Modifier and Type Field Description private final static Stringeol
-
Method Summary
Modifier and Type Method Description final StringgetEol()Runtime specific end of line. final static StringencodeToBase64(ByteArray $self)Encode the content of this byteArray to base64. final static StringencodeToBase64(String $self)Encode this string to base64. final static ByteArraydecodeBase64(String $self)Decode this base64 encoded string. final static StringfilterVars(String $self, Map<?, ?> parameters)Filter the target string substituting each key by its value. final static StringfilterVars(String $self, Pair<?, ?> parameters)Filter the target string substituting each key by its value. final static Stringfilter(String $self, String prefix, String suffix, Pair<String, ?> parameters)TODO. final static <T extends Enum<?>> TtoEnum(String $self, Function1<String, T> converter)TODO. final static <T extends Enum<?>> TtoEnumOrNull(String $self, Function1<String, T> converter)TODO. final static <T extends Any> TtoOrNull(String $self, KClass<T> type)TODO. final static List<MatchGroup>findGroups(Regex $self, String text)TODO. final static StringsnakeToCamel(String $self)Transform the target string from snake case to camel case. final static List<String>snakeToWords(String $self)final static StringwordsToSnake(List<String> $self)final static List<String>camelToWords(String $self)final static StringwordsToCamel(List<String> $self)final static StringwordsToTitle(List<String> $self)final static StringwordsToSentence(List<String> $self)final static StringtoWords(Enum<?> $self)final static StringcamelToSnake(String $self)Transform the target string from camel case to snake case. final static Stringbanner(String $self, String bannerDelimiter)Format the string as a banner with a delimiter above and below text. final static StringstripAnsi(String $self)final static StringstripAccents(String $self)TODO. final static InputStreamtoStream(String $self)TODO. final static Stringutf8(Integer bytes)TODO. final static StringprependIndent(String $self, Integer count, String pad)TODO. final static StringtoEnumValue(String $self)-
-
Method Detail
-
getEol
final String getEol()
Runtime specific end of line.
-
encodeToBase64
final static String encodeToBase64(ByteArray $self)
Encode the content of this byteArray to base64.
-
encodeToBase64
final static String encodeToBase64(String $self)
Encode this string to base64.
-
decodeBase64
final static ByteArray decodeBase64(String $self)
Decode this base64 encoded string.
-
filterVars
final static String filterVars(String $self, Map<?, ?> parameters)
Filter the target string substituting each key by its value. The keys format resembles Mustache's one:
{{key}}and all occurrences are replaced by the supplied value.If a variable does not have a parameter, it is left as it is.
- Parameters:
parameters- The map with the list of key/value tuples.
-
filterVars
final static String filterVars(String $self, Pair<?, ?> parameters)
Filter the target string substituting each key by its value. The keys format resembles Mustache's one:
{{key}}and all occurrences are replaced by the supplied value.If a variable does not have a parameter, it is left as it is.
- Parameters:
parameters- vararg of key/value pairs.
-
filter
final static String filter(String $self, String prefix, String suffix, Pair<String, ?> parameters)
TODO.
- Parameters:
prefix- .suffix- .parameters- .
-
toEnum
final static <T extends Enum<?>> T toEnum(String $self, Function1<String, T> converter)
TODO.
- Parameters:
converter- .
-
toEnumOrNull
final static <T extends Enum<?>> T toEnumOrNull(String $self, Function1<String, T> converter)
TODO.
- Parameters:
converter- .
-
toOrNull
final static <T extends Any> T toOrNull(String $self, KClass<T> type)
TODO.
- Parameters:
type- .
-
findGroups
final static List<MatchGroup> findGroups(Regex $self, String text)
TODO.
- Parameters:
text- .
-
snakeToCamel
final static String snakeToCamel(String $self)
Transform the target string from snake case to camel case.
-
snakeToWords
final static List<String> snakeToWords(String $self)
-
wordsToSnake
final static String wordsToSnake(List<String> $self)
-
camelToWords
final static List<String> camelToWords(String $self)
-
wordsToCamel
final static String wordsToCamel(List<String> $self)
-
wordsToTitle
final static String wordsToTitle(List<String> $self)
-
wordsToSentence
final static String wordsToSentence(List<String> $self)
-
toWords
final static String toWords(Enum<?> $self)
-
camelToSnake
final static String camelToSnake(String $self)
Transform the target string from camel case to snake case.
-
banner
final static String banner(String $self, String bannerDelimiter)
Format the string as a banner with a delimiter above and below text. The character used to render the delimiter is defined.
- Parameters:
bannerDelimiter- Delimiter char for banners.
-
stripAnsi
final static String stripAnsi(String $self)
-
stripAccents
final static String stripAccents(String $self)
TODO.
-
prependIndent
final static String prependIndent(String $self, Integer count, String pad)
TODO.
- Parameters:
count- .pad- .
-
toEnumValue
final static String toEnumValue(String $self)
-
-
-
-