Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Swapping two parts of a stringby Harch84 (Acolyte) |
on Jul 22, 2007 at 20:30 UTC ( [id://628142]=perlquestion: print w/replies, xml ) | Need Help?? |
Harch84 has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks I need your valued help again. I have a string which is passed to a perl variable from a html/javascript and returns a set of coordinates. An example of one of these coordinate strings would be this:
(55.950254, -3.187606) Now what I need to do is to get rid of the comma in this string and then to take the first part of coordinate "55.950254" and put it in front of the other part "-3.187606". The output should look like this:
(-3.187606 55.950254) I have managed to get rid of the comma using this command in Perl: ... but im not sure how I could swap the two strings around using perl? If it helps both parts should be exactly 9 characters long. Thanks for your help
Back to
Seekers of Perl Wisdom
|
|