aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorinoas <mail@inoas.com>2023-10-31 23:21:02 +0100
committerLouis Pilfold <louis@lpil.uk>2023-11-05 12:29:40 +0000
commit24db16703bcbc036b5c47aa66aa776f2e58d9b24 (patch)
tree67cca288387a9aaf4653aa714f93eef16afeab9b
parent5d08571cb57a5f2117a0ee9a06d7cc260b96ba1d (diff)
downloadgleam_stdlib-24db16703bcbc036b5c47aa66aa776f2e58d9b24.tar.gz
gleam_stdlib-24db16703bcbc036b5c47aa66aa776f2e58d9b24.zip
fix-example
-rw-r--r--src/gleam/string.gleam7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gleam/string.gleam b/src/gleam/string.gleam
index 729371f..bb03750 100644
--- a/src/gleam/string.gleam
+++ b/src/gleam/string.gleam
@@ -786,8 +786,9 @@ pub fn utf_codepoint(value: Int) -> Result(UtfCodepoint, Nil) {
/// ## Examples
///
/// ```gleam
-/// > utf_codepoint_to_int(128013) |> to_utf_codepoint_int
-/// 128013
+/// > let [utf_codepoint, ..] = to_utf_codepoints("💜")
+/// > utf_codepoint_to_int(utf_codepoint)
+/// 128156
/// ```
///
pub fn utf_codepoint_to_int(cp: UtfCodepoint) -> Int {
@@ -896,7 +897,7 @@ pub fn inspect(term: anything) -> String {
fn do_inspect(term term: anything) -> StringBuilder
/// Returns the number of bytes in a `String`.
-///
+///
/// This function runs in constant time on Erlang and in linear time on
/// JavaScript.
///