From 139aa856270ae203009ce523d70f7019cd34a94c Mon Sep 17 00:00:00 2001 From: Andres Kalle Date: Sun, 29 Sep 2024 00:04:31 +0300 Subject: [PATCH] Documented substring and superstring --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 582bff82..9a005b5f 100644 --- a/README.md +++ b/README.md @@ -332,6 +332,21 @@ const const player = { name: "Lu" }! print("Hello {player$name}!")! ``` +## String operations + +You can use the `substring` method to make strings shorter: + +```java +'Hello world!'.substring(2, -3) // 'llo wor' +``` + +Inversely, you can use the `superstring` method to make strings longer: + +```java +'llo wor'.superstring(-2, 3) // 'Hello world!' +``` + + ## Types Type annotations are optional.