Course of Raku / Essentials / Variables and data types essentials / Strings / String length

Quiz: The length of a phrase

What will the .chars method return for the following strings?

4'Raku' — (: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 :)
13'Raku & Rakudo' — (: 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 :)Spaces are also countable.
6'Ça va?' — (: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 :)Ç is a single Unicode character.
0'' — (: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 :)An empty string.
2'中国' — (: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 :)More than two bytes in UTF-8, but still only two characters.

Course navigation

String length   |   Hello, Concatenation!

Translations of this page: EnglishDeutschEspañolItalianoLatviešuNederlandsБългарскиРусскийУкраїнська