你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

translate()

Applies to: ✅ Microsoft FabricAzure Data ExplorerAzure MonitorMicrosoft Sentinel

Replaces a set of characters ('searchList') with another set of characters ('replacementList') in a given a string. The function searches for characters in the 'searchList' and replaces them with the corresponding characters in 'replacementList'

Syntax

translate(searchList, replacementList, source)

Learn more about syntax conventions.

Parameters

Name Type Required Description
searchList string ✔️ The list of characters that should be replaced.
replacementList string ✔️ The list of characters that should replace the characters in searchList.
source string ✔️ A string to search.

Returns

source after replacing all occurrences of characters in 'replacementList' with the corresponding characters in 'searchList'

Examples

Input Output
translate("abc", "x", "abc") "xxx"
translate("abc", "", "ab") ""
translate("krasp", "otsku", "spark") "kusto"