javascript - JS - Check if string contain only 0 -
i have data of day , need check if contain 0. how can check if string contain 0? want regular expressions.
/^0*$/.test(subject)
returns true
string contains nothing (any number of, including 0) zeroes. if don't want empty string match, use +
instead of *
.
Comments
Post a Comment