dev
Download
39 lines 889 BGroffModified 2025-11-29 raw
123456789101112131415161718192021222324252627282930313233343536373839
'\" t
.\" Copyright (c) 2025 Bruce Hill
.\" All rights reserved.
.\"
.TH Text.at 3 2025-11-29 "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
l l l.
Name	Type	Description
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
assert "Amélie".at(3) == "é"
.EE
.SH SEE ALSO
.BR Tomo-Text (3)