(39 lines)
1 '\" t2 .\" Copyright (c) 2025 Bruce Hill3 .\" All rights reserved.4 .\"5 .TH Path.has_extension 3 2025-11-29 "Tomo man-pages"6 .SH NAME7 Path.has_extension \- check if a path has a given extension8 .SH LIBRARY9 Tomo Standard Library10 .SH SYNOPSIS11 .nf12 .BI Path.has_extension\ :\ func(path:\ Path,\ extension:\ Text\ ->\ Bool)13 .fi14 .SH DESCRIPTION15 Return whether or not a path has a given file extension.18 .SH ARGUMENTS20 .TS21 allbox;22 lb lb lbx23 l l l.24 Name Type Description25 path Path A path.26 extension Text A file extension (leading \fB.\fR is optional). If empty, the check will test if the file does not have any file extension.27 .TE28 .SH RETURN29 Whether or not the path has the given extension.31 .SH EXAMPLES32 .EX33 assert (/foo.txt).has_extension("txt") == yes34 assert (/foo.txt).has_extension(".txt") == yes35 assert (/foo.tar.gz).has_extension("gz") == yes36 assert (/foo.tar.gz).has_extension("zip") == no37 .EE38 .SH SEE ALSO39 .BR Tomo-Path (3)