{
"id": "fn-string-slice",
"dataComponent": "string",
"heading": {
"title": "slice",
"badges": ["String", "PARTIAL"]
},
"synopsis": "Returns a substring from a string, using start and end indices (supports negative indices). Partial/placeholder usage supported.",
"codeBlocks": [
"extend(\"string\")\n\nsput( string:slice(\"Hello\", 1, 4) )\n# => \"ell\"\n\n# Negative index:\nsput( string:slice(\"abcdef\", -3, -1) )\n# => \"de\"\n\n# Partial usage:\nsliceStart = string:slice(_, 2, 5)\nsput( sliceStart(\"abcdefg\") )\n# => \"cde\""
],
"notes": [
"Arguments: string, start index, end index (exclusive).",
"Negative indices count from end.",
"Partial and _ supported."
]
}