Text.Start
語法
Text.Start(text as nullable text, count as number) as nullable text
關於
將 text
的前 count
個字元傳回為文字值。
範例 1
取得 "Hello, World" 的前 5 個字元。
使用方式
Text.Start("Hello, World", 5)
輸出
"Hello"
範例 2
使用名字的前四個字元和姓氏的前三個字元來建立個人的電子郵件位址。
使用方式
let
Source = #table(type table [First Name = text, Last Name = text],
{
{"Douglas", "Elis"},
{"Ana", "Jorayew"},
{"Rada", "Mihaylova"}
}),
EmailAddress = Table.AddColumn(
Source,
"Email Address",
each Text.Combine({
Text.Start([First Name], 4),
Text.Start([Last Name], 3),
"@contoso.com"
})
)
in
EmailAddress
輸出
#table(type table [First Name = text, Last Name = text, Email Address = text],
{
{"Douglas", "Elis", "DougEli@contoso.com"},
{"Ana", "Jorayew", "AnaJor@contoso.com"},
{"Rada", "Mihaylova", "RadaMih@contoso.com"}
})