'\" t .\" Copyright (c) 2025 Bruce Hill .\" All rights reserved. .\" .TH Text.by_split 3 2025-11-29 "Tomo man-pages" .SH NAME Text.by_split \- iterate by a spliting text .SH LIBRARY Tomo Standard Library .SH SYNOPSIS .nf .BI Text.by_split\ :\ func(text:\ Text,\ delimiter:\ Text\ =\ ""\ ->\ func(->Text?)) .fi .SH DESCRIPTION Returns an iterator function that can be used to iterate over text separated by a delimiter. .SH ARGUMENTS .TS allbox; lb lb lbx lb l l l l. Name Type Description Default text Text The text to be iterated over in delimited chunks. - delimiter Text An exact delimiter to use for splitting the text. "" .TE .SH RETURN An iterator function that returns one chunk of text at a time, separated by the given delimiter, until it runs out and returns `none`. .SH NOTES To split based on a set of delimiters, use Text.by_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 text := "one,two,three" for chunk in text.by_split(",") # Prints: "one" then "two" then "three": say(chunk) .EE .SH SEE ALSO .BR Tomo-Text (3)