VBScript UCase 函数

UCase

UCase 函数将输入的字符串转换为大写字母后返回字符串。

语法

UCase(String)

示例

<!DOCTYPE html>
<html>
   <body>
      <script language = "vbscript" type = "text/vbscript">
         var = "Microsoft VBScript"
         document.write("Line 1 : " & UCase(var) & "<br />")
         
         var = "MS VBSCRIPT"
         document.write("Line 2 : " & UCase(var) & "<br />")
         
         var = "microsoft"
         document.write("Line 3 : " & UCase(var) & "<br />")
      </script>
   </body>
</html>

当您将其另存为 .html 并在 Internet Explorer 中执行时,上述脚本将产生以下结果 −

Line 1 : MICROSOFT VBSCRIPT
Line 2 : MS VBSCRIPT
Line 3 : MICROSOFT

vbscript_strings.html