Thread Substitutionen (2 answers)
Opened by Tom at 2010-03-27 18:23

pq
 2010-03-27 18:27
#135382 #135382
User since
2003-08-04
12208 Artikel
Admin1
[Homepage]
user image
Code (perl): (dl )
1
2
3
my @quotes = qw/ ` ' /;
my $i = 0;
$string =~ s/"/$quotes[$i++ % 2]/g;


edit: /e entfernt, geht auch ohne
Last edited: 2010-03-27 18:31:08 +0100 (CET)
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. -- Damian Conway in "Perl Best Practices"
lesen: Wiki:Wie frage ich & perlintro Wiki:brian's Leitfaden für jedes Perl-Problem

View full thread Substitutionen