substring_index {SparkR} | R Documentation |
Returns the substring from string str before count occurrences of the delimiter delim. If count is positive, everything the left of the final delimiter (counting from left) is returned. If count is negative, every to the right of the final delimiter (counting from the right) is returned. substring_index performs a case-sensitive match when searching for delim.
substring_index(x, delim, count) ## S4 method for signature 'Column,character,numeric' substring_index(x, delim, count)
x |
a Column. |
delim |
a delimiter string. |
count |
number of occurrences of |
substring_index since 1.5.0
Other string_funcs: ascii
,
base64
, concat_ws
,
concat
, decode
,
encode
, format_number
,
format_string
, initcap
,
instr
, length
,
levenshtein
, locate
,
lower
, lpad
,
ltrim
, regexp_extract
,
regexp_replace
, reverse
,
rpad
, rtrim
,
soundex
, translate
,
trim
, unbase64
,
upper
## Not run:
##D substring_index(df$c, '.', 2)
##D substring_index(df$c, '.', -1)
## End(Not run)