From 24db16703bcbc036b5c47aa66aa776f2e58d9b24 Mon Sep 17 00:00:00 2001 From: inoas Date: Tue, 31 Oct 2023 23:21:02 +0100 Subject: fix-example --- src/gleam/string.gleam | 7 ++++--- 1 file 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. /// -- cgit v1.2.3