September 2017
Beginner
402 pages
9h 52m
English
There are many methods to change the register of the letters in a string. The first set contains simple lc and uc, which converts all characters to lower or upper case. Consider the following code snippet:
say 'String'.lc; # stringsay 'String'.uc; # STRING
The other four methods are more complex.
The fc method converts a string to the so-called fold case. It is intended to be used in string comparisons. For example, compare the output of the three methods called on a string with the German letter ß, which is spelled as SS in uppercase, but is converted to ss in the fold-case. Consider the following code snippet:
say 'Hello, Straße!'.lc; # hello, straße!say 'Hello, Straße!'.uc; # HELLO, STRASSE!say 'Hello, Straße!'.fc; ...
Read now
Unlock full access