Excel VBA, Trim(), LTrim(), RTrim(), Application.Trim()

 Sub test()

    MsgBox Trim("   apple   ")
    'apple
    MsgBox LTrim("   apple   ")
    'apple   
    MsgBox RTrim("   apple   ")
    '   apple
    MsgBox Trim("a   pple")
    'a   pple
    MsgBox Application.Trim("a   pple")
    'a pple

'Spaces contained in a string are removed.
'However, spaces in middle of the string are left only one space.
        
End Sub

댓글

이 블로그의 인기 게시물

<배당주 투자> 지주사, '22년 8월

<배당주 투자> ETF, ETN, '22년 9월

<배당주 투자> 분기배당주 '22년 10월