pub trait UmlautsOwned {
// Required methods
fn make_utf8_umlauts_lowercase(&mut self);
fn make_utf8_umlauts_uppercase(&mut self);
}
Expand description
Inplace string processing functions.
UnlautsInplaceExt
adds inplace string processing functions for the german “Umlauts”
‘ä’, ‘ö’, ‘ü’, ‘ß’ and their uppercase variants (except for uppercase ‘ß’).
Because these functions dont resize their containers or shift the containing data,
those methods are limited and should only be used if the higher performance
is absolutely needed.
Required Methods§
Sourcefn make_utf8_umlauts_lowercase(&mut self)
fn make_utf8_umlauts_lowercase(&mut self)
Lowercases alphabetic ASCII chars and UTF-8 umlauts.
Like make_ascii_lowercase
but it will also make utf8 umlauts lowercase:
- ‘Ä’ -> ‘ä’
- ‘Ö’ -> ‘ö’
- ‘Ü’ -> ‘ü’
§Examples
extern crate umlauts;
use umlauts::UmlautsOwned;
let mut s = "Öl Ärmel Übermut".as_bytes().to_vec();
s.make_utf8_umlauts_lowercase();
assert_eq!("öl ärmel übermut".as_bytes(), s);
Sourcefn make_utf8_umlauts_uppercase(&mut self)
fn make_utf8_umlauts_uppercase(&mut self)
Upercases alphabetic ASCII chars and UTF-8 umlauts.
Like make_ascii_uppercase
but it will also make utf8 umlauts uppercase:
- ‘ä’ -> ‘Ä’
- ‘ö’ -> ‘Ö’
- ‘ü’ -> ‘Ü’
§Examples
extern crate umlauts;
use umlauts::UmlautsOwned;
let mut s = "Öl Ärmel Übermut".as_bytes().to_vec();
s.make_utf8_umlauts_uppercase();
assert_eq!("ÖL ÄRMEL ÜBERMUT".as_bytes(), s);