Please visit our sponsors !
The Asc Function
The Asc function converts the first letter in a string to ANSI code, and
returns the result.
Syntax
Parameter |
Description |
string |
Required. A string
expression. Cannot be an empty string! |
Example 1
document.write(Asc("A") & "<br />")
document.write(Asc("F"))
Output:
65
70
|
Example 2
document.write(Asc("a") & "<br />")
document.write(Asc("f"))
Output:
97
102
|
Example 3
document.write(Asc("W") & "<br />")
document.write(Asc("W3Schools.com"))
Output:
87
87
|
Example 4
document.write(Asc("2") & "<br />")
document.write(Asc("#"))
Output:
50
35
|
Jump to: Top of Page
or HOME or
Printer friendly page
Search W3Schools:
What Others Say About Us
Does the world know about us? Check out these places:
Dogpile
Alta Vista
MSN
Google
Excite
Lycos
Yahoo
Ask Jeeves
We Help You For Free. You Can Help Us!
W3Schools is for training only. We do not warrant its correctness or its fitness for use.
The risk of using it remains entirely with the user. While using this site, you agree to have read and accepted our
terms of use and
privacy policy.
Copyright 1999-2002 by Refsnes Data. All Rights Reserved
|