Course of Raku / Essentials / Control flow essentials / Conditional checks

Comparing strings

String comparison uses its own set of operators:

eq | Equal ne | Not equal gt | Greater than ge | Greater than or equal lt | Less than le | Less than or equal

Examples

Examine a few examples of comparing two strings:

say 'alpha' lt 'beta'; # True
say 'word' ne 'Word';  # True
say 'xyz' gt 'xvw';    # True

Practice

Complete the quizzes that cover the contents of this topic.

Course navigation

Quiz — Compare numbers   |   Quiz 1 — Compare strings


💪 Or jump directly to the exercises in this section.

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