Function left

Source
pub fn left(s: &str, n: i32, writer: &mut impl Write)
Expand description

Returns the first n characters in the string. If n is a negative value, the function will return all but last |n| characters.

ยงExample

query T
select left('RisingWave', 6)
----
Rising

query T
select left('RisingWave', 42)
----
RisingWave

query T
select left('RisingWave', 0)
----
(empty)

query T
select left('RisingWave', -4)
----
Rising

query T
select left('RisingWave', -2147483648);
----
(empty)