starts_with
Builtin index · Collections & strings
result = starts_with(s, prefix)
Input: s, prefix · Output: result
What it is
s and prefix are Strs.
Overloads
One call shape — this function is not overloaded.
| Code | Input | Output | Description |
result = starts_with(s, prefix) | s Strnot documented yetprefix Strnot documented yet | result bool | Returns a bool: true if s starts with prefix. |
Examples
From the documentation, and run by the build -- the output and the figure below are what the engine actually produced. Simplest first.
s = " Hello, Qu World! "
trimmed = trim(s)
parts = split(trimmed, ", ")
print(parts) # ["Hello", "Qu World!"]
print(upper(parts[0])) # HELLO
print(starts_with(trimmed, "Hello")) # true
print("hello".substr(0, 2).replace("e", "i").flip().flip())
print("hi world".split(" ").join(", ") + "!")
output
("Hello", "Qu World!")
HELLO
true
hi
hi, world!from collections-strings