Thread split an einer bestimmten stelle (4 answers)
Opened by Charleen at 2010-06-04 16:23

pq
 2010-06-04 16:30
#138006 #138006
User since
2003-08-04
12208 Artikel
Admin1
[Homepage]
user image
oder wenn es nicht immer das erste space sein soll:
Code (perl): (dl )
1
2
3
4
my $n = 1;
my @words = split / /, $line;
splice @words, $n, 0, "du";
$line = join " ", @words;
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 split an einer bestimmten stelle