pub struct SvString { /* private fields */ }
Expand description
SvString data type. This string type consists of Unicode Scalar Value.
The len()
method returns the number of characters in
Unicode Scalar Value.
Implementations§
Source§impl SvString
impl SvString
Sourcepub fn to_standard_string(&self) -> String
pub fn to_standard_string(&self) -> String
Converts this string into String
type.
Sourcepub fn char_at(&self, index: i32) -> char
pub fn char_at(&self, index: i32) -> char
Obtains character at given position. If the index is out of bounds,
this method returns '\x00'
.
Sourcepub fn concat(&self, other: impl AnySvStringType) -> SvString
pub fn concat(&self, other: impl AnySvStringType) -> SvString
Concatenates two strings.
Sourcepub fn contains(&self, other: impl AnySvStringType) -> bool
pub fn contains(&self, other: impl AnySvStringType) -> bool
Determines whether the string contains another string.
Sourcepub fn starts_with(&self, other: impl AnySvStringType) -> bool
pub fn starts_with(&self, other: impl AnySvStringType) -> bool
Determines whether the string starts with another string.
Sourcepub fn ends_with(&self, other: impl AnySvStringType) -> bool
pub fn ends_with(&self, other: impl AnySvStringType) -> bool
Determines whether the string ends with another string.
Sourcepub fn index_of(&self, other: impl AnySvStringType) -> i32
pub fn index_of(&self, other: impl AnySvStringType) -> i32
Finds the index of the given string. If the argument is not found,
this method returns -1
.
Sourcepub fn last_index_of(&self, other: impl AnySvStringType) -> i32
pub fn last_index_of(&self, other: impl AnySvStringType) -> i32
Finds the last index of the given string. If the argument is not found,
this method returns -1
.
Sourcepub fn to_lowercase(&self) -> SvString
pub fn to_lowercase(&self) -> SvString
Converts string to lowercase.
Sourcepub fn to_uppercase(&self) -> SvString
pub fn to_uppercase(&self) -> SvString
Converts string to uppercase.
Sourcepub fn substr(&self, index: impl SvSubstringIndex) -> SvString
pub fn substr(&self, index: impl SvSubstringIndex) -> SvString
Extracts a substring.
Sourcepub fn substr_with_length(&self, from: i32, len: i32) -> SvString
pub fn substr_with_length(&self, from: i32, len: i32) -> SvString
Extracts a substring.
Sourcepub fn trim_right(&self) -> SvString
pub fn trim_right(&self) -> SvString
Removes trailing whitespace.