What is the use of the Chr() function in VBScript?
The Chr function:
The Chr function converts the specified ANSI character code to a character.
Note: The numbers from 0 to 31 represent nonprintable ASCII codes, i.e. Chr(10) will return a linefeed character.
The Chr function Syntax is as below:
Chr(charcode)
charcode - A number that identifies a character and it is Required.
The Chr function Examples are as follows:
Example-1
<%
response.write(Chr(97) & "<br />")
response.write(Chr(98) & "<br />")
response.write(Chr(99) & "<br />")
response.write(Chr(65) & "<br />")
response.write(Chr(66) & "<br />")
response.write(Chr(67) & "<br />")
%>
The output of the above code will be as below:
a
b
c
A
B
C
Example-2
<%
response.write(Chr(34) & "<br />")
response.write(Chr(35) & "<br />")
response.write(Chr(36) & "<br />")
response.write(Chr(37) & "<br />")
%>
The output of the above code will be as below:
"
#
$
%
What is the use of the Asc() function in VBScript?
What is the use of the Len() function in VBScript?
What is the use of Mid() function in VBScript?
What is the use of Spaces() function in VBScript?
What is the use of the Trim() function in VBScript?