NAME ^

src/builtins/any-str.pir - Str-like functions and methods for Any

DESCRIPTION ^

This file implements the methods and functions of Any that are most closely associated with the Str class or role. We place them here instead of src/classes/Any.pir to keep the size of that file down and to emphasize their generic, "built-in" nature.

Methods ^

chars()

comb()

Partial implementation for now, returns a list of strings (instead of a list of match objects).

index()

match()

rindex()

substr()

trans()

  Implementation of transliteration
subst

 our Str method Str::subst ( Any $string: Any $substring, Any $replacement )
 our Str method Str::subst ( Any $string: Code $regexp,   Any $replacement )
Replaces the first occurrence of a given substring or a regular expression match with some other substring.

Partial implementation. The :g modifier on regexps doesn't work, for example.


parrot