#!/usr/bin/perl -l # http://perlmonks.org/?node_id=1155716 use strict; use warnings; my $input = "abcdefghiaabccdjklm"; my $want = "efghijklm"; print $input; $input =~ s/.(??{ -1 == index("$`$'", $&) && '(*FAIL)' })//g; print $input; print $want; $input eq $want and print "Match!";
hehehe
In reply to Re: How to remove duplicate characters in a string in place
by tybalt89
in thread How to remove duplicate characters in a string in place
by punitpawar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |