GOLF(2gg)
β¨ GOLF(2gg) β¨
okay bestie, welcome to the GOLF manual, section 2gg β it's giving Development, it's giving dev tools, and honestly? it's iconic. sit down, grab a boba, we're learning about strings π
π NAME π
string-length β it lives in the (strings) family, iykyk π¦
πΈ PURPOSE πΈ
Get string length. that's it. that's the whole job. and it ate π
π§ SYNTAX π§
string-length <string> to <length>
π DESCRIPTION π
okay so here's the tea: string-length will place the number of bytes in <string> into the number <length>. no cap, that's literally all it does and it does it flawlessly π
heads up though bestie β<string>does not need to be null-terminated. which means it can be a binary string or a text string, whichever vibe it's serving. and<length>? that's just the number of bytes comprising any such string. simple. clean. gorgeous. β¨
π EXAMPLES π
first up β the variable "len" will be 6 π:
set-string str = "string"
string-length str to len
and next β the variable "len2" will be 18, because bestie the string has a null character right in the middle of it π:
set-string str2 = "string" "\x00 after null"
string-length str2 to len2
see how the null in the middle doesn't trip it up? main character energy fr fr π
π SEE ALSO π
- Strings
and the whole squad, the entire friend group, the full roster π:
concatenate-strings copy-string count-substring delete-string lower-string new-string read-split replace-string set-string split-string string-length trim-string upper-string write-string
See all documentation β yes there's more, go explore, you got this π«Ά
that's the whole page bestie!! this edition dropped on $DATE and it's version $VERSION, all wrapped up under the GOLF(2gg) banner β stay slay, stay stringy, mwah ππ
π¦ where this page comes from
- ubuntu questing: golf 601.4.41-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms