regex getting the first instance of a number from a string

前端 未结 3 1487
悲哀的现实
悲哀的现实 2021-01-15 03:42

I return the following string from a webpage

Order Number: 1509596 Customer Number: 8

but it coul

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-15 03:50

    if you change orderNumber.replaceAll("[^0-9]", "")

    to

    orderNumber.replaceAll("[^0-9]", ",") hence

    you will get ,1509596,8 as an answer,

    I think this is probably help you to solve ans.

提交回复
热议问题