aboutsummaryrefslogtreecommitdiff
path: root/man/man3/tomo-Text.at.3
blob: abdb8cce1c68de0e67fe84d94034c0fe5bd2117e (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
'\" t
.\" Copyright (c) 2025 Bruce Hill
.\" All rights reserved.
.\"
.TH Text.at 3 2025-04-21 "Tomo man-pages"
.SH NAME
Text.at \- get a letter
.SH LIBRARY
Tomo Standard Library
.SH SYNOPSIS
.nf
.BI Text.at\ :\ func(text:\ Text,\ index:\ Int\ ->\ Text)
.fi
.SH DESCRIPTION
Get the graphical cluster at a given index. This is similar to `str[i]` with ASCII text, but has more correct behavior for unicode text.


.SH ARGUMENTS

.TS
allbox;
lb lb lbx lb
l l l l.
Name	Type	Description	Default
text	Text	The text from which to get a cluster. 	-
index	Int	The index of the graphical cluster (1-indexed). 	-
.TE
.SH RETURN
A `Text` with the single graphical cluster at the given index.

.SH NOTES
Negative indices are counted from the back of the text, so `-1` means the last cluster, `-2` means the second-to-last, and so on.

.SH EXAMPLES
.EX
>> "Amélie".at(3)
= "é"
.EE