|
-
Aug 21st, 2001, 09:43 AM
#1
Thread Starter
Member
Javascript Asc or Chr?
Do those VB functions exist in Javascript?
-
Aug 21st, 2001, 11:22 AM
#2
Thread Starter
Member
Is there a reference like the Javadocs in Java for Javascript? Maybe it's listed there.
-
Aug 21st, 2001, 11:38 AM
#3
Lively Member
<HTML>
<HEAD>
<script>
for (i=1; i<=255; i++)
document.write( i + ": " + String.fromCharCode(i) + "<br>")
</script>
<TITLE></TITLE>
</HEAD>
<BODY>
</BODY>
</HTML>
-
Aug 21st, 2001, 11:41 AM
#4
Thread Starter
Member
Cool, thanks.
-
Aug 21st, 2001, 04:46 PM
#5
a little something from the javascript guide
Code:
charAt
Method. Returns the character at the specified index.
Syntax
stringName.charAt(index)
Parameters
stringName is any string or a property of an existing object.
index is any integer from zero to stringName.length - 1, or a
property of an existing object.
Implemented in
Navigator 2.0
Description
Characters in a string are indexed from left to right.
The index of the first character is zero, and the index
of the last character is stringName.length - 1.
If the index you supply is out of range,
JavaScript returns an empty string.
Examples
The following example displays characters at different
locations in the string "Brave new world":
var anyString="Brave new world"
document.write("The character at index 0 is " + anyString.charAt(0))
document.write("The character at index 1 is " + anyString.charAt(1))
document.write("The character at index 2 is " + anyString.charAt(2))
document.write("The character at index 3 is " + anyString.charAt(3))
document.write("The character at index 4 is " + anyString.charAt(4))
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|