PHP familiarity shortcuts

This commit is contained in:
udo
2026-04-19 21:15:52 +00:00
parent af642c8167
commit dc05f9faa5
29 changed files with 633 additions and 174 deletions
+22
View File
@@ -0,0 +1,22 @@
:sig
s64 strpos(String haystack, String needle, s64 offset = 0)
:params
haystack : string to search in
needle : substring to search for
offset : optional start offset; negative values count from the end of the string
return value : zero-based position of the first match, or `-1` if `needle` is not found
:desc
Finds the first occurrence of `needle` inside `haystack`.
This is the closest UCE equivalent to PHP `strpos()`, but it returns `-1` instead of `false` when no match is found.
If `needle` is an empty string, `strpos()` returns the normalized start offset.
:see
>string
:related
**PHP:** `strpos()`
**JavaScript / Node.js:** `String.prototype.indexOf()`