<?xml version='1.0'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:atom="http://www.w3.org/2005/Atom" >
<channel>
	<title><![CDATA[BOL: Perl script to delete the adjacent repeats !]]></title>
	<link>https://bioinformaticsonline.com/snippets/view/40910/perl-script-to-delete-the-adjacent-repeats?</link>
	<atom:link href="https://bioinformaticsonline.com/snippets/view/40910/perl-script-to-delete-the-adjacent-repeats?" rel="self" type="application/rss+xml" />
	<description><![CDATA[]]></description>
	
	<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/snippets/view/40910/perl-script-to-delete-the-adjacent-repeats</guid>
	<pubDate>Wed, 05 Feb 2020 23:09:15 -0600</pubDate>
	<link>https://bioinformaticsonline.com/snippets/view/40910/perl-script-to-delete-the-adjacent-repeats</link>
	<title><![CDATA[Perl script to delete the adjacent repeats !]]></title>
	<description><![CDATA[<code>/usr/bin/perl 

#Mostly the interview question for bioinfomatician !
#Write a code to delete the adjacent repeated character ....

$string=&#039;ATTTTTTGGC&#039;; # This should be converted to ATGC
$string =~ s/(\w)\1/$1/g;
print $string;

#For more helps ... check out this

#This bit of code will do the job:

$string =~ s/(.)\1/$1/g
#Alternatively, if you want to ignore case when comparing, you could use:

$string =~ s/(.)\1/$1/gi
#And finally, if you wanted to trim any number of duplicates down to a single letter, this would work:

$string =~ s/(.)\1+/$1/gi</code>]]></description>
	<dc:creator>Rahul Nayak</dc:creator>
</item>

</channel>
</rss>