Text.TrimEnd

구문

Text.TrimEnd(text as nullable text, optional trim as any) as nullable text

정보

지정한 후행 문자를 모두 제거한 결과를 반환합니다 text. 기본적으로 후행 공백 문자는 모두 제거됩니다.

  • text: 후행 문자를 제거할 텍스트입니다.
  • trim: 기본적으로 제거되는 공백 문자를 무시합니다. 이 매개 변수는 단일 문자 또는 단일 문자 목록일 수 있습니다. 트리밍되지 않은 문자가 발견되면 각 후행 트리밍 작업이 중지됩니다.

예 1

"a b c d "에서 후행 공백을 제거합니다.

사용법

Text.TrimEnd("     a b c d    ")

출력

" a b c d"

예제 2

패딩된 부동 소수점 숫자의 텍스트 표현에서 후행 0을 제거합니다.

사용법

Text.TrimEnd("03.487700000", "0")

출력

"03.4877"

예제 3

고정 너비 계정 이름에서 후행 공백 문자를 제거합니다.

사용법

let
    Source = #table(type table [Name = text, Account Name= text, Interest = number],
    {
        {"Bob", "US-847263****@", 2.8410},
        {"Leslie", "FR-4648****@**", 3.8392},
        {"Ringo", "DE-2046790@***", 12.6600}
    }),
    #"Trimmed Account" = Table.TransformColumns(Source, {{"Account Name", each Text.TrimEnd(_, {"*", "@"})}})
in
    #"Trimmed Account"

출력

#table(type table [Name = text, Account Name = text, Interest = number],
{
    {"Bob", "US-847263", 2.841},
    {"Leslie", "FR-4648", 3.8392},
    {"Ringo", "DE-2046790", 12.66}
})