pub trait StrExt {
// Required methods
fn repeat(&self, times: usize) -> String;
fn to_lowercase(&self) -> String;
fn to_uppercase(&self) -> String;
fn to_ascii_uppercase(&self) -> String;
fn to_ascii_lowercase(&self) -> String;
}Expand description
Extension trait to override methods that returns std’s String
Required Methods§
Sourcefn repeat(&self, times: usize) -> String
fn repeat(&self, times: usize) -> String
Creates a new String by repeating a string times.
§Panics
This function will panic if the capacity would overflow.
Sourcefn to_lowercase(&self) -> String
fn to_lowercase(&self) -> String
Returns the lowercase equivalent of this string slice, as a new String.
Sourcefn to_uppercase(&self) -> String
fn to_uppercase(&self) -> String
Returns the uppercase equivalent of this string slice, as a new String.
Sourcefn to_ascii_uppercase(&self) -> String
fn to_ascii_uppercase(&self) -> String
Returns a copy of this string where each character is mapped to its ASCII upper case equivalent.
ASCII letters ‘a’ to ‘z’ are mapped to ‘A’ to ‘Z’, but non-ASCII letters are unchanged.
Sourcefn to_ascii_lowercase(&self) -> String
fn to_ascii_lowercase(&self) -> String
Returns a copy of this string where each character is mapped to its ASCII lower case equivalent.
ASCII letters ‘A’ to ‘Z’ are mapped to ‘a’ to ‘z’, but non-ASCII letters are unchanged.