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