mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 00:24:34 +00:00
Fix Str.startsWithCodePoint docs
This commit is contained in:
parent
465c5fa18a
commit
83dde26cd0
2 changed files with 3 additions and 3 deletions
|
@ -161,8 +161,8 @@ startsWith : Str, Str -> Bool
|
||||||
## in a single code point, you can use (for example) `Str.startsWithCodePoint '鹏'`
|
## in a single code point, you can use (for example) `Str.startsWithCodePoint '鹏'`
|
||||||
## instead of `Str.startsWithCodePoint "鹏"`. ('鹏' evaluates to the [U32]
|
## instead of `Str.startsWithCodePoint "鹏"`. ('鹏' evaluates to the [U32]
|
||||||
## value `40527`.) This will not work for graphemes which take up mulitple code
|
## value `40527`.) This will not work for graphemes which take up mulitple code
|
||||||
## points, however; `Str.startsWithCodePoint '🕊'` would be a compiler error
|
## points, however; `Str.startsWithCodePoint '👩👩👦👦'` would be a compiler error
|
||||||
## because 🕊 takes up multiple code points and cannot be represented as a
|
## because 👩👩👦👦 takes up multiple code points and cannot be represented as a
|
||||||
## single [U32]. You'd need to use `Str.startsWithCodePoint "🕊"` instead.
|
## single [U32]. You'd need to use `Str.startsWithCodePoint "🕊"` instead.
|
||||||
startsWithCodePoint : Str, U32 -> Bool
|
startsWithCodePoint : Str, U32 -> Bool
|
||||||
|
|
||||||
|
|
|
@ -428,7 +428,7 @@ fn str_starts_with_code_point() {
|
||||||
bool
|
bool
|
||||||
);
|
);
|
||||||
assert_evals_to!(
|
assert_evals_to!(
|
||||||
&format!(r#"Str.startsWithCodePoint "boobar" {}"#, 'f' as u32),
|
&format!(r#"Str.startsWithCodePoint "zoobar" {}"#, 'f' as u32),
|
||||||
false,
|
false,
|
||||||
bool
|
bool
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue