substring, after Bjolang's rename of substring/cursors
🤖 Generated with [ECA](https://eca.dev) Co-Authored-By: eca-agent <git@eca.dev>
This commit is contained in:
parent
1ef2489224
commit
16278c2c92
1 changed files with 2 additions and 2 deletions
|
|
@ -1757,7 +1757,7 @@ A cursor is a position in a string. It is as cheap as an int, but it always sits
|
|||
(let* ((start (string-cursor-start s))
|
||||
(rest (string-cursor-next s start)))
|
||||
(string-append (char->string (char-upcase (string-cursor-ref s start)))
|
||||
(substring/cursors s rest (string-cursor-end s))))))
|
||||
(substring s rest (string-cursor-end s))))))
|
||||
|
||||
(capitalise "ölstuga") ;; "Ölstuga"
|
||||
|
||||
|
|
@ -1765,7 +1765,7 @@ A cursor is a position in a string. It is as cheap as an int, but it always sits
|
|||
(: first-word (-> string string))
|
||||
(defun (first-word s)
|
||||
(match (string-index char-whitespace? s)
|
||||
((Some c) (substring/cursors s (string-cursor-start s) c))
|
||||
((Some c) (substring s (string-cursor-start s) c))
|
||||
(None s)))
|
||||
|
||||
(first-word "hello there world") ;; "hello"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue