VBScript Rtrim 函式



RTrim

Rtrim 函式會移除字串右側的空格。

語法

RTrim(String)

示例

<!DOCTYPE html>
<html>
   <body>
      <script language = "vbscript" type = "text/vbscript">
         var = "Microsoft VBScript"
         document.write("After Rtrim : " & RTrim(var) & "<br />")

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

如果你將其儲存為 .html 格式並在 Internet Explorer 中執行,上述指令碼將生成以下結果 −

After Rtrim : Microsoft VBScript
vbscript_strings.htm
廣告
© . All rights reserved.