Convert java method to cpp

advertisements
public boolean isDoubleValue(String s) {
        try {
            Double.valueOf(s);
            return true;
        } catch (Exception e) {
            return false;
        }
    }

But i want to convert this method into QT cpp. Can any one help me?

Thanks, Nagaraju


Since you need it in Qt (from your comment), you can use

double QString::toDouble ( bool * ok = 0 ) const.

And you can check the value of ok and return accordingly..