FUNCTION::SUBSTR(3stap)
π FUNCTION::SUBSTR β bestie edition π
okay so this is a page from the SystemTap Tapset Reference, manual section 3stap, and it's literally all about one lil function that lives in a collection of standard string tapset stuff. it's giving "small but mighty". let's go π¦
β¨ NAME β¨
function::substr β Returns a substring π
like. that's it. that's the whole job. it hands you back a lil slice of a string. iconic behavior honestly.
π SYNOPSIS π
substr:string(str:string,start:long,length:long)
so it takes three things and gives you back a string. no cap. π₯
πΈ ARGUMENTS πΈ
strβ the string you're gonna take a substring from. your source material. your main character string. πstartβ the starting position of the extracted string. and bestie, listen: the first character is0. not 1. zero. the classic zero-index situation. don't come for me, that's just how it is πlengthβ how long the string you want back should be. that's the length of the string to return. π
π DESCRIPTION π
so basically: it returns the substring of the given string, at the given start position, with the given length. cute, right?
BUT β and this is the important part, bestie, don't skip it β you might get something smaller than the length you asked for. it gets trimmed down when either:
- the length of the original string is less than
start + length, or lengthis bigger thanMAXSTRINGLEN.
so like, if you're asking for more characters than there are to give, it just... gives you what it can. it's doing its best. π«Ά no error, no drama, just a shorter substring than you asked for. lowkey generous of it tbh.
π SEE ALSO π
tapset::string(3stap)β go read this one too, fr fr, it's the whole string tapset and it slays π
and that's the whole page!! go write some tapsets, you absolute genius π§β¨
this came to you from the SystemTap Tapset Reference, version info reading Ver, dated September 2026 β so yeah, fresh off the press, periodt. π
π
π¦ 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