VBScript StrReverse 函式



StrReverse

StrReverse 函式會反轉指定的字串。

語法

StrReverse(string) 

示例

<!DOCTYPE html>
<html>
   <body>
      <script language = "vbscript" type = "text/vbscript">
         document.write("Line 1 : " & StrReverse("VBSCRIPT") & "<br />")
         document.write("Line 2 : " & StrReverse("My First VBScript") & "<br />")
         document.write("Line 3 : " & StrReverse("123.45") & "<br />")

      </script>
   </body>
</html>

將其儲存為 .html 檔案,並在 Internet Explorer 中執行,則上述程式碼將會生成如下的結果 -

Line 1 : TPIRCSBV
Line 2 : tpircSBV tsriF yM
Line 3 : 54.321
vbscript_strings.htm
廣告