Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RegEx - Swap Character position

Status
Not open for further replies.

menkes

Programmer
Nov 18, 2002
47
US
First of all, this is a "lazy" post...I am so inundated with work I do not have the energy to research this so I am looking for a gimme. My apologies for being so rude.

Now, I need a quick and easy:
$var = 12345.7809-
I need to read that as a true numeric value, i.e. -12345.7809. The only way I know is string parsing. Better ideas??????
 
this would make the last character the first, no stipulation on type, but I suppose you could add that easily:

$var =~ s/^(.*)(.)$/$2$1/;

I've had those days, too. Best of luck with it. ----------------------------------------------------------------------------------
...but I'm just a C man trying to see the light
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top