How to get a character from a character code?
Messages   Related Types
This message was discovered on microsoft.public.dotnet.languages.jscript.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
Post a new message to this list...

Bona
What is the JScript counterpart of the VB function Chr(),
or in another words, how can I get a character knowing
a character code?
Reply to this message...
 
    
Michael Harris \(MVP\) (VIP)
Bona wrote:
[Original message clipped]

n = 97; // lowercase 'a'
s = String.fromCharCode(n);
WScript.echo(s);

s = String.fromCharCode(97,98,99); // lowercase 'abc'
WScript.echo(s);

--
Michael Harris
Microsoft.MVP.Scripting
Seattle WA US

Reply to this message...
 
    
Bona
Thanks, Michael.

[Original message clipped]

Reply to this message...
 
    
costas sotiriou
Is it possible to use the output of this function as an input to an HTML <IMG SRC="" > attribute? For example:
<img src="javascript:String.fromCharCode(...);" >
where the returned data is created from binary hex ??
Thanks a lot

--------------------------------
From: costas sotiriou
Reply to this message...
 
 
System.String




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com