How to extract specified characters with JavaScript?

received a set of JSON data about the weather. I want to extract the temperature now, but it can"t include . How can I intercept it? The current method of
is to do it with regular expressions, but what I want to ask is, can it be done without regular expressions?
JSON data example:
"High temperature 31.0C",
"low temperature 26.0C"

extract 31 and 26 of them.

Mar.23,2021

parseInt ("High temperature 31.0C" .split ('.') [0] .slice (- 2)


"High temperature 31.0 ". Slice (- 5homemade 3)

/ / 31


clipboard.png


"High temperature 31.0C" .match (/ [d] + /) [0]

Menu