Product Site

5.4.11.6. caselessContains

Returns .true if the receiving buffer contains the other string. It returns .false if other is the null string or is not found within the receiving buffer. The search is performed using caseless comparisons.

By default, the search starts at the first character of the receiving buffer and continues to the end of the buffer. You can override this by specifying start, the point at which the search starts, and length, the bounding limit for the search. If specified, start must be a positive whole number and length must be a non-negative whole number.

See also methods contains, caselessStartsWith, caselessEndsWith, and caselessPos.

Example 5.265. MutableBuffer class — caselessContains method
say .mutablebuffer~new('-abcdef-')~caselessContains('EF')         -- 1
say .mutablebuffer~new('-abcdef-')~caselessContains('-', 2, 6)    -- 0