We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c4a564d commit 322bed7Copy full SHA for 322bed7
docs/Runtime Environment/String.md
@@ -301,3 +301,16 @@ A new string.
301
print("58595a":fromhex()) --> XYZ
302
print("58 59 5A":fromhex()) --> XYZ
303
```
304
+---
305
+### `string.span`
306
+Returns a substring from a starting position and length. This differs from string.sub, which takes a start and end position.
307
+#### Parameters
308
+1. The string.
309
+2. The starting position.
310
+3. The length.
311
+#### Returns
312
+The substring.
313
+```pluto
314
+print("abcd":sub(2, 2)) --> b
315
+print("abcd":span(2, 2)) --> bc
316
+```
0 commit comments