I am trying to grab the temperature of St. Louis from
http://www.nws.noaa.gov/view/prodsByState.php?state=MO&prodtype=hourlythe line I get specifically is
Code
ST. LOUIS INTL PTSUNNY 35 17 47 N10G18 30.36F WCI 27
My code originally was something like
Code
info = crtLine.split("\\s");
what I expected:
Code
ST.
LOUIS
INTL
PTSUNNY
35
17
47
N10G18
30.36F
WCI
27
however I get an array where several of the elements are whitespace
What I need is that 35, the first number that appears.
I am not the best with regex.
I have a feeling I am missing something here.
Any java folks know what is up?
edit: so I have been testing with rubular
and if I do
Code
([0-9]+)\s
It seems to correctly return elements where the first element is the number I want, so I would imagine I could do str[0] and access it.
But instead I get
Code
ST.
LOUIS
INTL
PTSUNNY
(as one line)
This post was edited by Eep on Nov 12 2014 03:15pm