aboutsummaryrefslogtreecommitdiff
path: root/man/man3/tomo-Text.from.3
blob: 7b9a83fe087b89e398532aa367f00db2e0d93843 (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
'\" t
.\" Copyright (c) 2025 Bruce Hill
.\" All rights reserved.
.\"
.TH Text.from 3 2025-04-19T14:48:15.717080 "Tomo man-pages"
.SH NAME
Text.from \- Get a slice of the text, starting at the given position.

.SH LIBRARY
Tomo Standard Library
.SH SYNOPSIS
.nf
.BI Text.from\ :\ func(text:\ Text,\ first:\ Int\ ->\ Text)
.fi

.SH DESCRIPTION
Get a slice of the text, starting at the given position.


.TS
allbox;
lb lb lbx lb
l l l l.
Name	Type	Description	Default
text	Text	The text to be sliced. 	-
first	Int	The index to begin the slice. 	-
.TE
.SH RETURN
The text from the given grapheme cluster to the end of the text.

.SH NOTES
A negative index counts backwards from the end of the text, so `-1` refers to the last cluster, `-2` the second-to-last, etc. Slice ranges will be truncated to the length of the text.

.SH EXAMPLES
.EX
>> "hello".from(2)
= "ello"

>> "hello".from(-2)
= "lo"
.EE