Within given examples:
string output = string.Join(";", Regex.Matches("GPS: 48.8896 N - 2.37586 W", @"-?\d+\.\d+")
.OfType<Match>()
.Select(m => m.Value));
質問
GPS: 48.8896 N - 2.37586 W
GPS: 52.6399 N - -1.1267 W
I have those coordinates data after reading from the HTML File, and I want to have a regex that separate then combine them as a string with a semicolon in the middle like 48.8896;2.37586 or 52.6399;-1.1267 .
How could the pattern be in this case? Thank you
解決
Within given examples:
string output = string.Join(";", Regex.Matches("GPS: 48.8896 N - 2.37586 W", @"-?\d+\.\d+")
.OfType<Match>()
.Select(m => m.Value));