string tolower

Gives a string with its letters in lowercase.

string tolower STRING ?FIRST? ?LAST?

Description

Gives STRING with each uppercase letter changed to lowercase, with the case rules of Unicode for one character. Each other character stays.

With FIRST, only the characters from FIRST to LAST change. LAST is FIRST by default, so string tolower ABC 1 changes one character. The range has the clamp of string range, and a range with no character gives STRING.

Arguments

ArgumentTypeDefaultDescription
STRINGstringrequiredThe text to change.
FIRSTindex0The index of the first character to change.
LASTindexFIRST, or end with no FIRSTThe index of the last character to change.

Returns

The new string.

Examples

% string tolower ABC
abc

% string tolower ABC 1
AbC

% string tolower ABCDEF 1 3
AbcdEF

% string tolower "ÀÉÎ"
àéî

Errors

% string tolower
wrong # args: should be "string tolower string ?first? ?last?"
-errorcode NONE

% string tolower ABC 1 x
bad index "x": must be integer?[+-]integer? or end?[+-]integer?
-errorcode NONE

Facts

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

See also