Skip to main content

Text.starts_with

starts_withprefixcase_sensitivity

Group: Text
Aliases: check prefix

Documentation​

Checks whether self starts with prefix.

Arguments​

  • prefix: The prefix to see if self starts with.
  • case_sensitivity: Specifies if the text values should be compared case sensitively.

Examples​

See if the text "Hello!" starts with the specified prefix.​

      "Hello!".starts_with "Hello" == True
"Hello!".starts_with "hello" == False
"Hello!".starts_with "hello" Case_Sensitivity.Insensitive == True

Remarks​

Unicode Equality​

The definition of equality includes Unicode canonicalization. I.e. two texts are equal if they are identical after canonical decomposition. This ensures that different ways of expressing the same character in the underlying binary representation are considered equal.

      'ś' . starts_with 's' == False
's\u{301}' . starts_with 's' == False
's\u{301}' . starts_with 'ś' == True
'ś' . starts_with 's\u{301}' == True