MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / strip_prefix_ascii_ci

Function strip_prefix_ascii_ci

codegraph-kernel/src/php.rs:1694–1696  ·  view source on GitHub ↗

`s` without its prefix `p` when `s` starts with `p` in any ASCII letter case (JS `/^p/i`).

(s: &'a str, p: &str)

Source from the content-addressed store, hash-verified

1692/// `s` without its prefix `p` when `s` starts with `p` in any ASCII letter
1693/// case (JS `/^p/i`).
1694fn strip_prefix_ascii_ci<'a>(s: &'a str, p: &str) -> Option<&'a str> {
1695 s.get(..p.len()).filter(|head| head.eq_ignore_ascii_case(p)).map(|_| &s[p.len()..])
1696}
1697
1698/// phpConcatParts (languages/php.ts): the parts of a `.` concatenation, left
1699/// to right — `__DIR__ . '/inc/' . 'a.php'` is a left-nested tree of binary

Callers 1

php_use_shadows_dirnameFunction · 0.85

Calls 3

mapMethod · 0.80
lenMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected