Version 0.59.0

str::to_upper

Converts a string to uppercase letters.

Signatures

  •   string to_upper( string& input )
  •   string to_upper( string& input, int supplement )

Details

The function converts characters of input to their uppercase equivalents if these exist. If no such conversion is possible, the characters are left unchanged.

The basic version without supplement index only covers the Basic Latin letters a - z. The supplement index allows to additionally choose one additional character range.

Note

In its current form only a limited number of supplementary ranges are supported.

The following table gives an overview of supported supplementary ranges:

Supplement index Unicode number range Name Character range
0 U+0061 - U+007A Basic Latin a - z
1 U+00E0 - U+00F6, U+00F8 - U+00FE Latin 1 à - ö, ø - þ

Example

 #import( "std/str.sps" )
 string s = "Hello World!";
 echo( str::to_upper( s ) );
 

Output

 HELLO WORLD!
 

Return value

A string, representing the value of input converted to uppercase.

Parameters

input

String whose value is returned converted to uppercase.

supplement

An index that defines one additional character range that is converted in addition to Basic Latin. Default value is 0 (Basic Latin only).

See also

🗙

Search results for