diff options
| author | Joshua Gawley <16921823+joshuagawley@users.noreply.github.com> | 2024-12-20 10:18:52 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-20 10:18:52 +0000 |
| commit | 69536853589016b60efef4d9e39f8bb811040980 (patch) | |
| tree | 7b511812a05eee1ccebee2e9f67619841e284abf | |
| parent | c3334a55fe53253b55943a4b713bff532e876d95 (diff) | |
Document result of splitting string with empty string as separator (#5572)
| -rw-r--r-- | crates/typst-library/src/foundations/str.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/crates/typst-library/src/foundations/str.rs b/crates/typst-library/src/foundations/str.rs index 5a939fdb..8ac99ac6 100644 --- a/crates/typst-library/src/foundations/str.rs +++ b/crates/typst-library/src/foundations/str.rs @@ -575,6 +575,11 @@ impl Str { /// Splits a string at matches of a specified pattern and returns an array /// of the resulting parts. + /// + /// When the empty string is used as a separator, it separates every + /// character in the string, along with the beginning and end of the + /// string. In practice, this means that the resulting list of parts + /// will contain the empty string at the start and end of the list. #[func] pub fn split( &self, |
