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
| Argument | Type | Default | Description |
|---|---|---|---|
| STRING | string | required | The text to change. |
| FIRST | index | 0 | The index of the first character to change. |
| LAST | index | FIRST, or end with no FIRST | The 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