delphi Integer.tryParse

会返回异常

Integer.Parse(string)

不会返回异常

Integer.tryParse('12',i);
 

结果:true 12

Integer.tryParse('12a',i);

结果:false 12

Integer.tryParse('a12',i);

结果:false 0

Integer.tryParse('1a2',i);

结果:false 1

猜你喜欢

转载自blog.csdn.net/ozhy111/article/details/81942924