Module string

Module string 

Source

Enums§

Alignment
Defines the padding type: Left, Right, or Center. Alignment options for padding strings.

Traits§

CaseTransform
Provides case-related string transformations.
UtilityTransform
Provides miscellaneous string utilities like reversing, splitting, truncation, templating, parsing, and padding.
WordTransform
Provides word-based and wrapping utilities.

Functions§

camel_case
Converts string to camelCase.
capitalize
Converts the first character of string to upper case and the remaining to lower case.
ends_with
Checks if string ends with the given target string.
ends_with_position
Checks if string ends with the given target string with the given position
kebab_case
Converts a string to kebab-case.
lower_first
Converts the first character of string to lower case.
safe_parse
Tries to parse a string into a value of type T. Returns Some(T) if successful, otherwise None.
screaming_snake_case
Converts a string to SCREAMING_SNAKE_CASE.
slugify
Converts a string to a URL-friendly slug format.
snake_case
Converts a string to snake_case.
starts_with
Checks if string starts with the given target string.
starts_with_position
Checks if string starts with the given target string at some given position
str_pad
Pad a string to a certain length using another string as padding.
str_rev
Reverses the input string.
str_split
Splits a string by the given delimiter and returns a Vec<String>.
template
Replaces placeholders in the given text with corresponding values from a hashmap.
title_case
Converts a string to Title Case.
truncate_middle
Truncates the middle of a string with an ellipsis (…).
upper_first
Converts the first character of string to lower case.
words
Splits string into an array of its words.
words_with_pattern
Splits string into an array of its words with the given pattern.
wordwrap
Wraps a string to a given number of characters using a string break character.