Skip to main content

is_name_start_char

Function is_name_start_char 

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

Returns true if the character can start an XML name.

Per XML 1.0, a name start character is: letter, underscore, or colon. We follow TinyXML2’s practical definition which covers ASCII letters, underscore, colon, and the common Unicode letter ranges.

§Examples

use tinyxml2::util::is_name_start_char;

assert!(is_name_start_char('a'));
assert!(is_name_start_char('Z'));
assert!(is_name_start_char('_'));
assert!(is_name_start_char(':'));
assert!(!is_name_start_char('0'));
assert!(!is_name_start_char('-'));
assert!(!is_name_start_char('.'));