用法
pub fn to_ascii_lowercase(&self) -> String
返回此字符串的副本,其中每个字符都映射到其等效的 ASCII 小写字母。
ASCII 字母 'A' 到 'Z' 映射到 'a' 到 'z',但非 ASCII 字母保持不变。
要就地小写值,请使用 make_ascii_lowercase
。
除了非 ASCII 字符之外,要小写 ASCII 字符,请使用to_lowercase
.
例子
let s = "Grüße, Jürgen ❤";
assert_eq!("grüße, jürgen ❤", s.to_ascii_lowercase());
相关用法
- Rust str.to_ascii_uppercase用法及代码示例
- Rust str.to_uppercase用法及代码示例
- Rust str.to_lowercase用法及代码示例
- Rust str.trim_left用法及代码示例
- Rust str.trim用法及代码示例
- Rust str.trim_left_matches用法及代码示例
- Rust str.trim_right_matches用法及代码示例
- Rust str.trim_start用法及代码示例
- Rust str.trim_start_matches用法及代码示例
- Rust str.trim_right用法及代码示例
- Rust str.trim_end_matches用法及代码示例
- Rust str.trim_end用法及代码示例
- Rust str.trim_matches用法及代码示例
- Rust str.make_ascii_uppercase用法及代码示例
- Rust str.strip_suffix用法及代码示例
- Rust str.char_indices用法及代码示例
- Rust str.split_inclusive用法及代码示例
- Rust str.as_ptr用法及代码示例
- Rust str.escape_debug用法及代码示例
- Rust str.encode_utf16用法及代码示例
注:本文由纯净天空筛选整理自rust-lang.org大神的英文原创作品 str.to_ascii_lowercase。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。