M
mick white
str="West Ham 4 Chelsea 3"
Ideally to
["West Ham",4,"Chelsea",3]
but the following is OK:
["West Ham","4","Chelsea","3"]
The problem of course is the space that sometimes is in the team name.
ARR=str.replace(/([a-z]) ([A-Z])/g,"$1_$2").split(",");
Which replaces the troublesome space with an underscore. I can then
remove the underscore, but I'm looking for a more elegant solution.
??
Mick
Ideally to
["West Ham",4,"Chelsea",3]
but the following is OK:
["West Ham","4","Chelsea","3"]
The problem of course is the space that sometimes is in the team name.
ARR=str.replace(/([a-z]) ([A-Z])/g,"$1_$2").split(",");
Which replaces the troublesome space with an underscore. I can then
remove the underscore, but I'm looking for a more elegant solution.
??
Mick