aboutsummaryrefslogtreecommitdiff
path: root/man/man3/tomo-Text.split.3
blob: 11d4eb3302e8a82aaeade03beb296e413899e82a (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
40
41
42
'\" t
.\" Copyright (c) 2025 Bruce Hill
.\" All rights reserved.
.\"
.TH Text.split 3 2025-09-06 "Tomo man-pages"
.SH NAME
Text.split \- split a text by a delimiter
.SH LIBRARY
Tomo Standard Library
.SH SYNOPSIS
.nf
.BI Text.split\ :\ func(text:\ Text,\ delimiter:\ Text\ =\ ""\ ->\ [Text])
.fi
.SH DESCRIPTION
Splits the text into a list of substrings based on exact matches of a delimiter.


.SH ARGUMENTS

.TS
allbox;
lb lb lbx lb
l l l l.
Name	Type	Description	Default
text	Text	The text to be split. 	-
delimiter	Text	The delimiter used to split the text. 	""
.TE
.SH RETURN
A list of subtexts resulting from the split.

.SH NOTES
To split based on a set of delimiters, use Text.split_any().
If an empty text is given as the delimiter, then each split will be the graphical clusters of the text.

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

>> "abc".split()
= ["a", "b", "c"]
.EE