[Bioperl-l] deleting string fragments?

Gyoergy Abrusan abrusan at mpil-ploen.mpg.de
Thu Apr 1 04:33:24 EST 2004


Dear All,

I would like to ask whether there is a command that deletes a certain 
fragment of a sring.

what I mean is:
eg. I have stings like

adfdfgfgg-dfgdfmgfgfgfg

I would like to remove -dfg and print out only

adfdfgfggdfmgfgfgfg

Is there a commad (something similar to chop)that removes an arbitrary 
substring from a string (the place of the target sequences is alvays 
different)?

eg.:

open (OUT, ">RESULTS.txt")

while(<>)
{
if ($_=~ /-dfg/g)
	{cut out -dfg  ???
	 print OUT "$_";}

else
	{print OUT "$_";}
}
close OUT;


I would greatly appreciate any help.
Thanking you in advance.

Best,

Gyorgy Abrusan







More information about the Bioperl-l mailing list