substr Tcl Command

NAME

substr - parse a substring

SYNOPSIS

::dmh::substr string left right

DESCRIPTION

This command is used to extract the first substring in input string string that is bounded on the left by the token left and on the right by right. If either left or right is not found in the string, an empty result is returned. If the right is an empty string, everything after the left argument is returned. Also, an empty string may be used for the left argument to match the beginning of a string. For example:

set title "Notepad - substr.n"
set filename [substr $title "Notepad - " ""]
set appname [substr $title "" " -"]

AUTHOR

Ed Hume, Hume Integration Software

KEYWORDS

string, substring