FUNCTION::STRPOS(3stap)
π FUNCTION::STRPOS π
okay bestie, so this little cutie lives in the A collection of standard strin manual, and it's literally the page you want when you're out here hunting for one string inside another. it's giving detective energy πβ¨
β¨ NAME β¨
function::strpos</purl> β returns location of a substring within another string π
πΈ SYNOPSIS πΈ
strpos:long(s1:string,s2:string)
like, that's the whole vibe. two strings go in, a long comes out. slay. π
π¦ ARGUMENTS π¦
s1β the string to search in. this is your main character, the place where the searching happens πs2β the substring to find. this is the little one you're looking for, the "where are you bestie" of it all π₯Ί
π DESCRIPTION π
so here's the tea, fr fr. this function returns the location of the first occurence of string s2 within s1.
and the way that works is: the return value is 0 in case s2 is a prefix of s1. so if your substring is sitting right at the very front like it owns the place? boom, zero. iconic.
but if s2 is not a substring of s1 at all β like, she's just not there, no cap β then the return value is -1. π
so yeah, no cap, those are the two special cases you gotta keep in your head: 0 for "she's at the front" and -1 for "she's not here". periodt. π
π SEE ALSO π
tapset::string(3stap)β go read this one too bestie, it's the whole string tapset and it's lowkey essential π«Ά
anyway that's the page!! this came to you from the SystemTap Tapset Reference, version Ver, dated September 2026 π thanks for reading, mwah, go grep something and stay hydrated πβ¨π¦π
π¦ where this page comes from
- centos-stream 10: systemtap-client 5.6-3.el10 Β· GPL-2.0-or-later AND GPL-2.0-only AND BSD-3-Clause AND LGPL-2.1-only AND GFDL-1.2-or-later AND BSD-2-Clause
- centos-stream 9: systemtap-client 5.6-3.el9 Β· GPL-2.0-or-later AND GPL-2.0-only AND BSD-3-Clause AND LGPL-2.1-only AND GFDL-1.2-or-later AND BSD-2-Clause
- fedora 43: systemtap-client 5.6-1.fc43 Β· GPL-2.0-or-later AND GPL-2.0-only AND BSD-3-Clause AND LGPL-2.1-only AND GFDL-1.2-or-later AND BSD-2-Clause
- fedora 44: systemtap-client 5.6-1.fc44 Β· GPL-2.0-or-later AND GPL-2.0-only AND BSD-3-Clause AND LGPL-2.1-only AND GFDL-1.2-or-later AND BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms