[Project_owners] Converting Strings to Char Arrays in Javascript

Wladimir Palant trev at gtchat.de
Sun Jul 31 22:23:52 EDT 2005


WC Leung wrote:

> Is there any method faster than the following stupid way? Since I'm
> placing the code on my extension, using XPCOM is okay.
> 
> var count = s.length;
> for (var i = 0; i<count; i++) a[i] = s.charCodeAt(i);

You can use s.match(/./g), but that might be even more stupid...

regards,
Wladimir


More information about the Project_owners mailing list