VBScript Chr Function

## VBScript Tutorial

VB HOME VB How to VB Variables VB Procedures VB Conditional VB Looping VB Summary

## VB Examples

VB Examples

## VB References

VB Functions VB Keywords

# VBScript Chr Function

Complete VBScript Reference

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

Note: The numbers from 0 to 31 represents nonprintable ASCII codes, i.e. Chr(10) will return a linefeed character.

### Syntax

Chr(charcode)

Parameter | Description
--- | ---
charcode | Required. A number that identifies a character

## 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>

The output of the code above will be:

A
B
C
a
b
c
Try it yourself »

## 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>

The output of the code above will be:

"
#
$
%
Try it yourself »

Complete VBScript Reference

## Your suggestion:

Your E-mail (optional):

Page address:

Description:

Close [X]

## Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

## WEB HOSTING

Best Web Hosting UK Reseller Hosting Wow! $5 SSD Hosting

## WEB BUILDING

Download XML Editor
FREE Website BUILDER FREE Website Creator

## WEB RESOURCES

Web Statistics Web Validation

## SHARE THIS PAGE