Skip to main content

is_whitespace

Function is_whitespace 

Source
pub const fn is_whitespace(ch: char) -> bool
Expand description

Returns true if the character is XML whitespace.

XML 1.0 defines whitespace as: space (0x20), tab (0x09), carriage return (0x0D), and line feed (0x0A).

§Examples

use tinyxml2::util::is_whitespace;

assert!(is_whitespace(' '));
assert!(is_whitespace('\t'));
assert!(is_whitespace('\n'));
assert!(is_whitespace('\r'));
assert!(!is_whitespace('a'));