VBA - 字串反轉函式



StrReverse 函式可以反轉指定的字串。

語法

StrReverse(string) 

示例

新增一個按鈕並新增以下函式。

Private Sub Constant_demo_Click()
   msgbox("Line 1 : " & StrReverse("VBSCRIPT"))
   msgbox("Line 2 : " & StrReverse("My First VBScript"))
   msgbox("Line 3 : " & StrReverse("123.45"))
End Sub

執行上述函式時,會產生以下輸出。

Line 1 : TPIRCSBV
Line 2 : tpircSBV tsriF yM
Line 3 : 54.321
vba_strings.htm
廣告
© . All rights reserved.