比如说,我有一个类似"150测试“的字符串。如何将此字符串转换为值为150的数字?
谢谢
发布于 2018-10-06 13:24:35
使用数字parseInt方法。
console.log( Number.parseInt('150 test') );
https://stackoverflow.com/questions/52679492
相似问题