Function roe::make_ascii_uppercase [−][src]
pub fn make_ascii_uppercase<T: AsMut<[u8]>>(slice: &mut T)
Converts the given slice to its ASCII upper case equivalent in-place.
ASCII letters 'a' to 'z' are mapped to 'A' to 'Z', but non-ASCII letters are unchanged.
This function can be used to implement String#upcase!
for ASCII strings
in Ruby.
To return a new uppercased value without modifying the existing one, use
to_ascii_uppercase
.
See also <[u8]>::make_ascii_uppercase
.
Examples
let mut buf = *b"ABCxyz"; make_ascii_uppercase(&mut buf); assert_eq!(buf, *b"ABCXYZ"); let mut buf = *b"1234%&*"; make_ascii_uppercase(&mut buf); assert_eq!(buf, *b"1234%&*");