icu_properties::sets

Function id_start

Source
pub const fn id_start() -> CodePointSetDataBorrowed<'static>
Expand description

Characters that can begin an identifier. If using NFKC to fold differences between characters, use load_xid_start instead. See Unicode Standard Annex #31 for more details.

Enabled with the compiled_data Cargo feature.

📚 Help choosing a constructor

§Example

use icu::properties::sets;

let id_start = sets::id_start();

assert!(id_start.contains('x'));
assert!(!id_start.contains('1'));
assert!(!id_start.contains('_'));
assert!(id_start.contains('ߝ'));  // U+07DD NKO LETTER FA
assert!(!id_start.contains('ⓧ'));  // U+24E7 CIRCLED LATIN SMALL LETTER X
assert!(id_start.contains32(0xFC5E));  // ARABIC LIGATURE SHADDA WITH DAMMATAN ISOLATED FORM