I am writing if statement like that:
String value;
if(int.parse(value)) // I want to write a condition that if error appear while parsing
// (like value contains some strings) then if statement run
It can be achieved by writing try/catch
try{
int.parse(value)
}
catch (e) {
// implement if statement
}
But I want to do this with if statement
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.