pub trait StrAsciiExt { fn to_ascii_upper(&self) -> ~str; fn to_ascii_lower(&self) -> ~str; fn eq_ignore_ascii_case(&self, other: &str) -> bool; }
Extension methods for ASCII-subset only operations on string slices
fn to_ascii_upper(&self) -> ~str
Makes a copy of the string in ASCII upper case: ASCII letters 'a' to 'z' are mapped to 'A' to 'Z', but non-ASCII letters are unchanged.
fn to_ascii_lower(&self) -> ~str
Makes a copy of the string in ASCII lower case: ASCII letters 'A' to 'Z' are mapped to 'a' to 'z', but non-ASCII letters are unchanged.
fn eq_ignore_ascii_case(&self, other: &str) -> bool
Check that two strings are an ASCII case-insensitive match.
Same as to_ascii_lower(a) == to_ascii_lower(b)
,
but without allocating and copying temporary strings.
impl<'self> StrAsciiExt for &'self str
Prefix searches with a type followed by a colon (e.g.
fn:
) to restrict the search to a given type.
Accepted types are: fn
, mod
,
struct
(or str
), enum
,
trait
, typedef
(or
tdef
).