Function icu::properties::sets::load_white_space
source · [−]pub fn load_white_space(
provider: &impl DataProvider<WhiteSpaceV1Marker>
) -> Result<CodePointSetData, PropertiesError>
Expand description
Spaces, separator characters and other control characters which should be treated by programming languages as “white space” for the purpose of parsing elements
Example
use icu_properties::sets;
let data =
sets::load_white_space(&icu_testdata::unstable())
.expect("The data should be valid");
let white_space = data.as_borrowed();
assert!(white_space.contains(' '));
assert!(white_space.contains32(0x000A)); // NEW LINE
assert!(white_space.contains32(0x00A0)); // NO-BREAK SPACE
assert!(!white_space.contains32(0x200B)); // ZERO WIDTH SPACE