aboutsummaryrefslogtreecommitdiff
path: root/man/man3/tomo-Text.split_any.3
blob: 734dc7691507164c72b0f8873d762bc918da1938 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
'\" t
.\" Copyright (c) 2025 Bruce Hill
.\" All rights reserved.
.\"
.TH Text.split_any 3 2025-04-21T14:58:16.953265 "Tomo man-pages"
.SH NAME
Text.split_any \- split a text by multiple delimiters
.SH LIBRARY
Tomo Standard Library
.SH SYNOPSIS
.nf
.BI Text.split_any\ :\ func(text:\ Text,\ delimiters:\ Text\ =\ "\ $\[rs]t\[rs]r\[rs]n"\ ->\ [Text])
.fi
.SH DESCRIPTION
Splits the text into a list of substrings at one or more occurrences of a set of delimiter characters (grapheme clusters).


.SH ARGUMENTS

.TS
allbox;
lb lb lbx lb
l l l l.
Name	Type	Description	Default
text	Text	The text to be split. 	-
delimiters	Text	A text containing delimiters to use for splitting the text. 	"\ $\[rs]t\[rs]r\[rs]n"
.TE
.SH RETURN
A list of subtexts resulting from the split.

.SH NOTES
Splitting will occur on every place where one or more of the grapheme clusters in `delimiters` occurs.
To split based on an exact delimiter, use Text.split().

.SH EXAMPLES
.EX
>> "one, two,,three".split_any(", ")
= ["one", "two", "three"]
.EE