beetlebug▾
/

namespace tail

Gives the part of a name after its last ::.

namespace tail STRING

Description

Gives the text of STRING after the last ::, the short name. A name with no :: gives the whole name, and a name that ends with :: gives an empty string. It reads the text only.

Arguments

ArgumentTypeDefaultDescription
STRINGstringrequiredA name.

Returns

The short name.

Examples

% namespace tail ::a::b::c
c

% namespace tail a
a

% namespace tail ::

Errors

% namespace tail
wrong # args: should be "namespace tail string"
-errorcode TCL WRONGARGS

Facts

Capability
None.
Tcl release
Tcl 9.1 and 8.6.
Since
ztcl 1.0.0-beta.1

See also