Text.TrimStart
删除所有指定的前导字符。
Syntax
Text.TrimStart(
text as text,
optional trim as any
) as text
Remarks
返回从指定的 text 中删除所有前导字符的结果。默认情况下,将删除所有前导空格字符。
text: 要从中删除前导字符的文本。trim: 替代默认剪裁的空格字符。此参数可以是单个字符或单个字符的列表。遇到非剪裁字符时,每个前导剪裁操作都会停止。
Examples
Example #1
从 " a b c d " 删除前导空格。
Text.TrimStart(" a b c d ")
Result:
"a b c d "
Example #2
从数字的文本表示形式中删除前导零。
Text.TrimStart("0000056.420", "0")
Result:
"56.420"
Example #3
从固定宽度帐户名称中删除前导填充字符。
let
Source = #table(type table [Name = text, Account Name= text, Interest = number],
{
{"Bob", "@****847263-US", 2.8410},
{"Leslie", "@******4648-FR", 3.8392},
{"Ringo", "@***2046790-DE", 12.6600}
}),
#"Trimmed Account" = Table.TransformColumns(Source, {{"Account Name", each Text.TrimStart(_, {"*", "@"})}})
in
#"Trimmed Account"
Result:
#table(type table [Name = text, Account Name = text, Interest = number],
{
{"Bob", "847263-US", 2.841},
{"Leslie", "4648-FR", 3.8392},
{"Ringo", "2046790-DE", 12.66}
})
Category
Text.Transformations