string toupper

Gives a string with its letters in uppercase.

string toupper STRING ?FIRST? ?LAST?

Description

Gives STRING with each lowercase letter changed to uppercase, one character at a time: a letter that becomes two letters in a full case change, such as ß, stays as it is. FIRST and LAST follow the rules of string tolower.

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 toupper abc
ABC

% string toupper abc 0 0
Abc

% string toupper straße
STRAßE

% string toupper abc 2 1
abc

Errors

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

Facts

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

See also