GOLF(2gg)
π GOLF(2gg) β the concatenate-strings page, bestie edition π
okay so real quick, this is page GOLF(2gg) from the Development manual, and it's literally all about smashing strings together. grab a snack, we're doing this π
β¨ NAME β¨
concatenate-strings β (strings) π
πΈ PURPOSE πΈ
Add strings using a plus ("+") sign. that's it. that's the whole job. iconic behavior honestly π
π¦ SYNTAX π¦
<string> + <string> [ + ... ]
like, keep stacking them. the [ + ... ] is your little invitation to go feral π₯
π DESCRIPTION π
So here's the vibe: string variables and string literals can produce a brand-new string by concatenation, and the whole thing runs on that plus ("+") clause. no cap.
And the way this is so flexible?? You can use concatenation in any statement where a string is expected. anywhere. any statement. she's welcome everywhere, main character energy fr fr π
okay but the important bit β bestie, listen β you can concatenate binary strings too. yes, the ones that do not end with a null character. each binary string gets used in its true length, and the result will in general be a binary string. that's just how it is π
π EXAMPLES π
okay first example, we're concatenating two string constants AND a variable called "var". watch:
set-string var = "day"
set-string newstr = "nice " + var + " it is!"
print-out newstr new-line
and the result? "nice day it is!" β we ate, no crumbs ππ
Second one, this is the practical girlie. Here, directory (that's variable "dir") is concatenated with a forward slash ("/") and then the file name (variable "file") to produce the full path of a file to read:
read-file dir+"/"+file to content
see how clean that is? full path, one line, slay β¨
π SEE ALSO π
- Strings
and the whole friend group, all of them, in order:
concatenate-stringscopy-stringcount-substringdelete-stringlower-stringnew-stringread-splitreplace-stringset-stringsplit-stringstring-lengthtrim-stringupper-stringwrite-string
also: See all documentation π«Ά
okay that's the whole page, you're basically a string-concatenation expert now, i'm so proud of you π₯Ή this was $VERSION from $DATE, mwah, go forth and plus things together πππ¦
π¦ 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