js截取字符串中的数字 首先有两种方法 使用正则表达式 let str="hello world !123654" let strReplace=str.replace(/[^0-9]/ig,""); console.log('strReplace',strReplace)//'123654' 使用js方法 var str = "2350元月"; var strNnum = parseInt(str); console.log('strNnum',strNnum);//2350