main
Download
41 lines 960 BGroffModified 2025-11-29 raw
1234567891011121314151617181920212223242526272829303132333435363738394041
'\" t
.\" Copyright (c) 2025 Bruce Hill
.\" All rights reserved.
.\"
.TH Text.split 3 2025-11-29 "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
assert "one,two,,three".split(",") == ["one", "two", "", "three"]
assert "abc".split() == ["a", "b", "c"]
.EE
.SH SEE ALSO
.BR Tomo-Text (3)