Latest web development tutorials

VBScript Chr function

VBScript Reference Complete VBScript Reference

Chr function to the specified ANSI character code to a character.

Note: A number from 0 to 31 represent nonprintable ASCII codes, for example, Chr (10) returns a line break.

grammar

Chr(charcode)

参数 描述
charcode 必需。标识某个字符的数字。

Examples

Example 1

<script type="text/vbscript">

document.write(Chr(65) & "<br />")
document.write(Chr(66) & "<br />")
document.write(Chr(67) & "<br />")
document.write(Chr(97) & "<br />")
document.write(Chr(98) & "<br />")
document.write(Chr(99) & "<br />")

</script>

Examples of the above output:

A
B
C
a
b
c

try it"

Example 2

<script type="text/vbscript">

document.write(Chr(34) & "<br />")
document.write(Chr(35) & "<br />")
document.write(Chr(36) & "<br />")
document.write(Chr(37) & "<br />")

</script>

Examples of the above output:

"
#
$
%

try it"

VBScript Reference Complete VBScript Reference