Please login or register.

Login with username, password and session length
Advanced search  

News:

For WME related articles and tutorials visit WME Resource Center.

Author Topic: ToInt  (Read 2169 times)

0 Members and 1 Guest are viewing this topic.

yaobifeng

  • Lurker
  • *
  • Karma: 1
  • Offline Offline
  • Gender: Male
  • Posts: 24
    • View Profile
ToInt
« on: July 11, 2008, 10:15:59 AM »

var s=new String("2");
var i=ToInt(s);
the result is i=0;
why?
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: ToInt
« Reply #1 on: July 11, 2008, 10:18:28 AM »

Probably because "new String" creates a string *object*. Any reason for using string objects instead of simple strings?
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave
 

Page created in 0.047 seconds with 23 queries.