Text.Combine
Text.Combine(texts as list, optional separator as nullable text) as text
傳回將文字值清單 (texts
) 結合成單一文字值的結果。 忽略 texts
中出現的任何 null
值。 可以指定最終合併文字中所使用的選擇性 separator
。
結合文字值 "Seattle" 與 "WA"。
使用方式
Text.Combine({"Seattle", "WA"})
輸出
"SeattleWA"
結合文字值 "Seattle" 與 "WA",並以逗號和空格分隔。
使用方式
Text.Combine({"Seattle", "WA"}, ", ")
輸出
"Seattle, WA"
結合文字值 "Seattle"、null
與 "WA",並以逗號和空格分隔。 (請注意,會忽略 null
。)
使用方式
Text.Combine({"Seattle", null, "WA"}, ", ")
輸出
"Seattle, WA"
使用方式
將名字、中間名縮寫 (如果有的話) 和姓氏結合成個人的完整姓名。
let
Source = Table.FromRecords({
[First Name = "Doug", Middle Initial = "J", Last Name = "Elis"],
[First Name = "Anna", Middle Initial = "M", Last Name = "Jorayew"],
[First Name = "Rada", Middle Initial = null, Last Name = "Mihaylova"]
}),
FullName = Table.AddColumn(Source, "Full Name", each Text.Combine({[First Name], [Middle Initial], [Last Name]}, " "))
in
FullName
輸出
Table.FromRecords({
[First Name = "Doug", Middle Initial = "J", Last Name = "Elis", Full Name = "Doug J Elis"],
[First Name = "Anna", Middle Initial = "M", Last Name = "Jorayew", Full Name = "Anna M Jorayew"],
[First Name = "Rada", Middle Initial = null, Last Name = "Mihaylova", Full Name = "Rada Mihaylova"]
})