String functions
| Name | Description | Complexity |
| contains(String, String): Boolean | Checks whether the string contains substring | 3 |
| drop(String, Int): String | Returns a given string without the first N characters | 20 |
| dropRight(String, Int): String | Returns a given string without the last N characters | 20 |
| indexOf(String, String): Int|Unit | Returns the index of the first occurrence of a substring | 3 |
| indexOf(String, String, Int): Int|Unit | Returns the index of the first occurrence of a substring after a certain index | 3 |
| lastIndexOf(String, String): Int|Unit | Returns the index of the last occurrence of a substring | 3 |
| lastindexOf(String, String, Int): Int|Unit | Returns the index of the last occurrence of a substring before a certain index | 3 |
| makeString(List[String], String): String | Range of functions. Concatenate list strings adding a separator | 1–11 |
| size(String): Int | Returns the size of a string | 1 |
| split(String, String): List[String] | Range of functions. Split a string delimited by a separator into a list of substrings | 1–51 |
| take(String, Int): String | Takes the first N characters from a string | 20 |
| takeRight(String, Int): String | Takes the last N characters from a string | 20 |
contains(String, String): Boolean
Checks whether the string contains substring.
Parameters
| Parameter | Description |
haystack: String | String to search in |
needle: String | String to search for |
Examples
drop(String, Int): String
Returns a given string without the first N characters.
Parameters
| Parameter | Description |
xs: String | String |
number: Int | Number N. From 0 to 32,767 |
Examples
dropRight(String, Int): String
Returns a given string without the last N characters of a string.
Parameters
| Parameter | Description |
xs: String | String |
number: Int | Number N. From 0 to 32,767 |
Examples
indexOf(String, String): Int|Unit
Returns the index of the first occurrence of a substring.
Parameters
| Parameter | Description |
str: String | String |
substr: String | Substring |
Examples
indexOf(String, String, Int): Int|Unit
Returns the index of the first occurrence of a substring after a certain index.
Parameters
| Parameter | Description |
str: String | String |
substr: String | Substring |
offset: Int | Index |
Examples
lastIndexOf(String, String): Int|Unit
Returns the index of the last occurrence of a substring.
Parameters
| Parameter | Description |
str: String | String |
substr: String | Substring |
Examples
lastIndexOf(String, String, Int): Int|Unit
Returns the index of the last occurrence of a substring before a certain index.
Parameters
| Parameter | Description |
str: String | String |
substr: String | Substring |
offset: Int | Index |
Examples
makeString(List[String], String): String
Range of functions. Concatenate list strings adding a separator.
| Name | Limitations | Complexity |
| makeString | Input list up to 70 elements; result up to 500 bytes | 1 |
| makeString_2C | Input list up to 100 elements; result up to 6000 bytes | 2 |
| makeString_11C | — | 11 |
Parameters
| Parameter | Description |
arr: List[String] | List of strings to concatenate |
separator: String | Separator |
Example
size(String): Int
Returns the size of a string.
Parameters
| Parameter | Description |
xs: String | String |
Examples
split(String, String): List[String]
Range of functions. Split a string delimited by a separator into a list of substrings.
| Name | Limitations | Complexity |
| split | Input string up to 500 bytes; result up to 20 elements | 1 |
| split_4C | Input string up to 6000 bytes; result up to 100 elements | 4 |
| split_51C | — | 51 |
Parameters
| Parameter | Description |
str: String | String |
separator: Int | Separator |
Examples
take(String, Int): String
Takes the first N characters from a string.
Parameters
| Parameter | Description |
xs: String | String |
number: Int | Number N. From 0 to 32,767 |
Examples
takeRight(String, Int): String
Takes the last n characters from a string.
Parameters
| Parameter | Description |
xs: String | String |
number: Int | Number N. From 0 to 32,767 |
Examples