java String

来源:互联网 发布:天猫淘宝商城女装冬装 编辑:程序博客网 时间:2024/05/22 08:14

'1.2.3.4.5'

I would like to get this output

'1.2345'
function process( input ) {    var index = input.indexOf( '.' );    if ( index > -1 ) {        input = input.substr( 0, index + 1 ) +                 input.slice( index ).replace( /\./g, '' );    }    return input;}








原创粉丝点击