STRING FUNCTION
String_split:
Splits the
given string by the specified delimiter. Output of this
function will
be a vector value.
String_split_no_empty:
This function
behaves as same as string_split function. But only difference is,
this function
will remove empty strings from the result set.
String_index:
The function
returns the index of the first character in the first occurrence of the
string.
a.
Index numbering of the string starts with 1.
b. If the string length is zero, then the functions returns 1.
c. If the string is not present, then the function returns 0.
d. The functions returns NULL if either of the argument is NULL.
String_rindex:
The function
returns the index of the first character for the last occurrence of the
string.
a. Index numbering of the string starts with 1.
b. If the string length is zero, then the functions returns 1.
c. If the string is not present, then the function returns 0.
d. The functions returns NULL if either of the argument is NULL.
|
SYNTAX AND EXAMPLE
String_split:
Syntax-string_split(string
str, string sep_str)
Example-
String_split(quick,brown,fox,",") returns
[vector
"quick", "brown", "fox"]
String_split_no_empty:
Syntax-string_split_no_empty(string
str, string sep_str)
Example-
Difference
between the Sting_split() and String_split_no_empty()functions:
String_split(“abc\ndef\n","\n")
⇒ [vector
"abc","def",""] -- Empty strings in the
result set
String_split_no_empty(abc\ndef\n","\n")
⇒ [vector
"abc","def"] – Empty strings will be removed
string_index:
Syntax - string_index(string str, string find_str [ ,
integer offset ] )
Example - string_index("to be or not to
be","be") result: 4
string_rindex:
Syntax - string_rindex(string str, string find_str [ ,
integer offset ] )
Example - string_index("to be or not to
be","be") result: 17
|