Knowledgebase

javascipt help

Posted by creativeartist, 02-15-2010, 02:15 AM
Hi How we can check whether all the elements of a string is 0. If is all zero must return a flase.Pls help

Posted by CArmstrong, 02-15-2010, 02:24 AM
You could use a for loop to iterate through all the elements of the string, from 0 to its length-1. Or you could convert the string to an integer and check if it's 0. That will tell you if all the elements are 0 (i.e. it will convert to the integer 0).

Posted by SlavaT, 02-15-2010, 03:04 AM

Posted by mattle, 02-15-2010, 10:46 AM
Yikes

Posted by creativeartist, 02-17-2010, 02:22 AM
Does this possible through regular expressions?

Posted by mattle, 02-17-2010, 09:34 AM
Um...yes...

Posted by creativeartist, 02-17-2010, 12:35 PM
This will return true or false?

Posted by mattle, 02-17-2010, 04:46 PM
That is correct.



Was this answer helpful?

Add to Favourites Add to Favourites

Print this Article Print this Article

Also Read
Rackspace AD (Views: 623)
Very high loads (Views: 613)


Language:

Client Login

Email

Password

Remember Me

Search