SparkR (version 2.1.2)

translate: translate

Description

Translate any character in the src by a character in replaceString. The characters in replaceString is corresponding to the characters in matchingString. The translate will happen when any character in the string matching with the character in the matchingString.

Usage

translate(x, matchingString, replaceString)

# S4 method for Column,character,character translate(x, matchingString, replaceString)

Arguments

x

a string Column.

matchingString

a source string where each character will be translated.

replaceString

a target string where each matchingString character will be replaced by the character in replaceString at the same location, if any.

See Also

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, substring_index, trim, unbase64, upper

Examples

Run this code
# NOT RUN {
translate(df$c, 'rnlt', '123')
# }

Run the code above in your browser using DataCamp Workspace