Murali Pusala and Stefan Pabst
01 October 2021
less than a minute read
The Standard Library has been updated and expanded to include various new String functionalities to better handle and manipulate string data. New functions include:
Name | Description |
string_join | Concatenates String or Character data. |
string_replace | Searches for a string pattern and replaces it. |
string_trim | Trims string by deleting leading and trailing whitespaces. |
concat | oncatenates two strings. |
char / byte | Returns the character at a specific index/byte position. |
num_chars / num_bytes | Count the characters/bytes of a string. |
A few examples seeing these new functions in action:
def output[1] = concat["Hello ", "World"] // "Hello World"
def output[2] = string_join[", ",
{(1, "a"); (2, "b"); (3, "c")}
] // "a, b, c"
Relation:
1 | "Hello World" |
2 | "a, b, c" |
def output[1] = string_trim[" This works "] // "This works"
def output[2] = string_replace["rAI", 'r', 'R'] // "RAI"
Relation:
1 | "This works" |
2 | "RAI" |
def output[1] = num_chars["中文例子"] // 4
def output[2] = char["grün", 3] // 'ü'
Relation:
1 | 4 |
2 | 'ü' |
We are excited to announce worksheets, a new interface for submitting Rel queries. Worksheets allow you to develop blocks of Rel code and run them against a database. They can be shared with other users using their URLs.
Read MoreWe are excited to announce the support of varargs in Rel. You can use varargs to write more general code that works for multiple arities. Varargs can be useful when writing generic relations for common utilities.
Read MoreValue types help distinguish between different kinds of values, even though the underlying representation may be identical. Value types can be used to define other value types.
Read More