pub fn position(str: &str, sub_str: &str) -> i32
Expand description
Returns the index of the first occurrence of the specified substring in the input string, or zero if the substring is not present.
§Example
query I
select position('om' in 'Thomas');
----
3
query I
select strpos('hello, world', 'lo');
----
4
query I
select strpos('high', 'ig');
----
2
query I
select strpos('abc', 'def');
----
0
query I
select strpos('床前明月光', '月光');
----
4