get values from JTextFields input
I have written small program that works with coordinates.
I want to use JTextField for insertion coords like this: "(x,y)".
So my first problem is how to get values x and y from string "(x,y)".
My first idea is to get rid of brackets and then split string with .split(',').
Is it good approach, or there is some better way to do it?
My second problem is how to make my input more flexible.
For example somethimes I'll have input: "(x, y)" or " ( x, y ) ", and I still want to get values from it.
Is it good to work with regular expressions in this case?