Files
el/lang/tests/text/examples/count-overlap-skip.el
2026-05-05 01:38:51 -05:00

12 lines
358 B
EmacsLisp

// count-overlap-skip.el non-overlapping advance: "aaaa" / "aa" -> 2.
// After each match, the cursor advances by len(sub), so overlapping matches
// are skipped. This is the universal default in C/Python/Go/etc.
fn run_test() -> Int {
let s: String = "aaaa"
return str_count(s, "aa")
}
fn main() -> Void {
println(int_to_str(run_test()))
}