Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim s = "POINT(921021.98 6671778.45)"
- Dim b1 = s.IndexOf("("c) + 1
- Dim b2 = s.IndexOf(")"c) - 1
- Dim parts = s.Substring(b1, b2 - b1 + 1).Split({" "c})
- Dim x As Decimal = Decimal.Parse(parts(0))
- Dim y As Decimal = Decimal.Parse(parts(1))
- Dim s = "POINT(921021.98 6671778.45)"
- Dim x As Decimal
- Dim y As Decimal
- Dim re = New Regex("((?<x>[0-9-.]+) (?<y>[0-9-.]+))")
- Dim m = re.Match(s)
- If m.Success Then
- x = Decimal.Parse(m.Groups("x").Value)
- y = Decimal.Parse(m.Groups("y").Value)
- Else
- ' Could not parse point. Do something about it if required.
- End If
- Dim s = "POINT(921021.98 6671778.45)"
- Dim part1 As String = s.Remove(0, 6)
- Dim part2 As String = part1.Substring(0, part1.Length - 1)
- Dim split() As String = part2.Split(" ")
- Dim x = split(0)
- Dim y = split(1)
- Dim s as String = "POINT(921021.98 6671778.45)"
- Dim coordinate() as String = s.Replace("POINT(", "").Replace(")", "").Split(" ")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement