RosettaCodeData/Task/String-matching/Tcl/string-matching-2.tcl

4 lines
153 B
Tcl

set isPrefix [string match $needle* $haystack]
set isContained [string match *$needle* $haystack]
set isSuffix [string match *$needle $haystack]