R3m/framework Function reference string.occurrence

{string.occurrence(String $haystack, String $needle, Boolean $before_needle=false)}

Find the first occurrence of a string.

Returns part of haystack string starting from and including the first occurrence of needle to the end of haystack.


This function is case-sensitive. 
For case-insensitive searches, use string.occurrence.case.insensitive.


If you only want to determine if a particular needle occurs within haystack, use the faster and less memory intensive function {string.position.first.occurrence()} instead.

Returns the portion of string, or false if needle is not found.

More information:


Last modified: 2021-06-07

© 2021 universeorange.com