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 dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delate from var

Status
Not open for further replies.

PerlElvir

Technical User
Aug 23, 2005
68

Have can I replace or delete some text from var?

example:

$var= ; 1679.25 FF =- something =70,00

now I want to delete from ; to - and get

$var=- something =70,00
 
One way is with substitution - something like this should work:
Code:
$var =~ s/;[^-]+//;
With this problem, you could also accomplish the same thing with a combination of the index and substr functions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top