strings
stdlib::rss::strings
String comparison, searching, splitting, trimming, and replacement helpers.
Import
use stdlib::rss::strings;
Functions
| Function | Description |
|---|---|
equals | Returns whether two strings are equal. |
is_empty | Returns whether a string is empty. |
non_empty | Returns whether a string is not empty. |
contains | Returns whether a string contains a substring. |
split | Splits a string on a separator. |
trim | Trims leading and trailing ASCII whitespace from a string. |
replace | Replaces all matching substrings in a string. |
Function details
equals
pub fn equals(lhs: string, rhs: string) -> bool
Returns whether two strings are equal.
is_empty
pub fn is_empty(value: string) -> bool
Returns whether a string is empty.
non_empty
pub fn non_empty(value: string) -> bool
Returns whether a string is not empty.
contains
pub fn contains(haystack: string, needle: string) -> bool
Returns whether a string contains a substring.
split
pub fn split(value: string, separator: string) -> [string]
Splits a string on a separator.
trim
pub fn trim(value: string) -> string
Trims leading and trailing ASCII whitespace from a string.
replace
pub fn replace(value: string, needle: string, replacement: string) -> string
Replaces all matching substrings in a string.