Function str_index_of_b

Source
pub fn str_index_of_b(s1: &str, s2: &str, s3: usize) -> i64
Expand description

Returns the index of the last occurrence of one string within a substring of another string.

The function searches for the string s2 within a substring of s1 that extends from the start to an index initially set to the length of s1. It performs this search s3 times. During each iteration, if the target string s2 is found, the index of its last occurrence is updated as the new search boundary for the next iteration. If s2 is not found during any iteration, or if the search reaches the beginning of s1, the function returns -1. The function ultimately returns the index as an i64 type.