Yes, the correct JavaScript code looks like this:
var s = "2828282800000";
while(s.endsWith("0"))
{
s = s.substring(0,s.length-1);
}
alert(s);
Regards,
Michael
On 6/30/06, 破宝 <[EMAIL PROTECTED]> wrote:
>
> I'm diving into the source codes these days. Yesterday I met the codes
> like below:
>
> while(s.EndsWith("0"))
> {
> s.Substring(0,s.Length-1);
> }
>
> (JavaScriptSerializer.cs line 115 to line 122)
>
> Is it an endless loop? Does the author really want to write something
> like below:
>
> while(s.EndsWith("0"))
> {
> s = s.Substring(0,s.Length-1);
> }
>
>
> >
>
--
Best regards | Schöne Grüße
Michael
Microsoft MVP - Most Valuable Professional
Microsoft MCAD - Certified Application Developer
http://weblogs.asp.net/mschwarz/
http://www.schwarz-interactive.de/
mailto:[EMAIL PROTECTED]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ajax.NET Professional" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/ajaxpro
The latest downloads of Ajax.NET Professional can be found at
http://www.ajaxpro.info
-~----------~----~----~----~------~----~------~--~---