本文简要介绍rust语言中 char.is_whitespace 的用法。用法pub fn is_whitespace(self) -> bool 如果此 char 具有White_Space 属性,则返回 true。 White_Space 在Unicode Character Database PropList.txt 中指定。 例子 基本用法: assert!(' '.is_whitespace()); // a non-breaking space assert!('\u{A0...
Empowering everyone to build reliable and efficient software. - Auto merge of #132500 - RalfJung:char-is-whitespace-const, r=jhpratt · rust-lang/rust@cf2b370
Program/Source Code: The source code to check a given character is a whitespace character or not is given below. The given program is compiled and executed successfully. // Rust program to check whether a given character// is a whitespace character or notfnmain() {letmutch:char=' ';let...