How to convert a string into a Point in C#
Posted
by NateD
on Stack Overflow
See other posts from Stack Overflow
or by NateD
Published on 2010-04-27T02:29:58Z
Indexed on
2010/04/27
2:33 UTC
Read the original article
Hit count: 316
I have a list of strings of the format "x,y". I would like to make them all into Points. The best Point constructor I can find takes two ints. What is the best way in C# to turn "14,42"
into new Point(14,42);
?
I know the Regex for doing that is /(\d+),(\d+)/
, but I'm having a hard time turning those two match groups into ints in C#.
any help you could offer would be appreciated.
© Stack Overflow or respective owner