From 8d4f9304c0539442e0e2273a4e8fa10379178881 Mon Sep 17 00:00:00 2001 From: Leedehai <18319900+Leedehai@users.noreply.github.com> Date: Fri, 19 May 2023 08:41:58 -0400 Subject: Update string doc: index can be negative (#1198) --- docs/src/reference/types.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'docs/src') diff --git a/docs/src/reference/types.md b/docs/src/reference/types.md index cc30ef1f..a5741337 100644 --- a/docs/src/reference/types.md +++ b/docs/src/reference/types.md @@ -219,7 +219,8 @@ Typst provides utility methods for string manipulation. Many of these methods either a string or a [regular expression]($func/regex). This makes the methods quite versatile. -All lengths and indices are expressed in terms of UTF-8 bytes. +All lengths and indices are expressed in terms of UTF-8 characters. Indices are +zero-based and negative indices wrap around to the end of the string. ### Example ```example -- cgit v1.2.3