(40 lines)
1 '\" t2 .\" Copyright (c) 2025 Bruce Hill3 .\" All rights reserved.4 .\"5 .TH Text.find 3 2025-11-29 "Tomo man-pages"6 .SH NAME7 Text.find \- find a substring8 .SH LIBRARY9 Tomo Standard Library10 .SH SYNOPSIS11 .nf12 .BI Text.find\ :\ func(text:\ Text,\ target:\ Text,\ start:\ Int\ =\ 1\ ->\ Int)13 .fi14 .SH DESCRIPTION15 Find a substring within a text and return its index, if found.18 .SH ARGUMENTS20 .TS21 allbox;22 lb lb lbx lb23 l l l l.24 Name Type Description Default25 text Text The text to be searched. -26 target Text The target text to find. -27 start Int The index at which to begin searching. 128 .TE29 .SH RETURN30 The index where the first occurrence of `target` appears, or `none` if it is not found.32 .SH EXAMPLES33 .EX34 assert "one two".find("one") == 135 assert "one two".find("two") == 536 assert "one two".find("three") == none37 assert "one two".find("o", start=2) == 738 .EE39 .SH SEE ALSO40 .BR Tomo-Text (3)