aboutsummaryrefslogtreecommitdiff
path: root/man/man3/tomo-Text.without_suffix.3
blob: 1f46556e981804508c7a6ebd7a3fb7277b02b774 (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
'\" t
.\" Copyright (c) 2025 Bruce Hill
.\" All rights reserved.
.\"
.TH Text.without_suffix 3 2025-04-27 "Tomo man-pages"
.SH NAME
Text.without_suffix \- remove suffix
.SH LIBRARY
Tomo Standard Library
.SH SYNOPSIS
.nf
.BI Text.without_suffix\ :\ func(text:\ Text,\ suffix:\ Text\ ->\ Text)
.fi
.SH DESCRIPTION
Returns the text with a given suffix removed (if present).


.SH ARGUMENTS

.TS
allbox;
lb lb lbx lb
l l l l.
Name	Type	Description	Default
text	Text	The text to remove the suffix from. 	-
suffix	Text	The suffix to remove. 	-
.TE
.SH RETURN
A text without the given suffix (if present) or the unmodified text if the suffix is not present.

.SH EXAMPLES
.EX
>> "baz.foo".without_suffix(".foo")
= "baz"
>> "qux".without_suffix(".foo")
= "qux"
.EE