blob: 99023a8d48ec3319ef1f091542f074f46a58b77f (
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-04-19T14:48:15.717773 "Tomo man-pages"
.SH NAME
Text.split \- Splits the text into a list of substrings based on exact matches of 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.
.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
|