{
"id": "fn-string-concat",
"dataComponent": "string",
"heading": {
"title": "concat",
"badges": [
"String",
"PARTIAL"
]
},
"synopsis": "Concatenates two strings, supporting partial usage and underscore placeholders for either argument",
"codeBlocks": [
"extend(\"string\")\n\n# 1) Direct usage: Provide both parameters now\nresult = string:concat(\"Hello, \", \"World!\")\nsput(result) // => \"Hello, World!\"\n\n# 2) Partial usage: Provide only the first parameter\nmyConcat = string:concat(\"abc\")\n\nresultA = myConcat(\"def\")\nsput(resultA) // => \"abcdef\"\n\nresultB = myConcat(\"xyz\")\nsput(resultB) // => \"abcxyz\"\n\n# 3) Partial usage with underscore placeholder for the first parameter\nmyConcat2 = string:concat(_, \"World!\")\n\nsput( myConcat2(\"Hello, \") ) // => \"Hello, World!\"\nsput( myConcat2(\"Greetings, \") ) // => \"Greetings, World!\""
],
"notes": [
"Only accepts two string parameters in total.",
"Allows partial application if one argument is omitted or uses underscore (_).",
"Once both strings are known, it returns a single concatenated string."
]
}