|< 1 2 >| | 13 Einträge, 2 Seiten |
$pos[$n] = index($suche[$n], "-13-1")
1
2
3
4
5
6
7
8
9
use strict;
use warnings;
my $string = '-13-4-1-2-3-13-1';
my $search = '-13-1';
my $pos = ( split /$search/, $string )[0];
$pos =~ tr/-//d;
print length( $pos ) + 1 . "\n";
1
2
3
4
5
6
7
8
my $string = '-13-4-1-2-3-13-1-13-4-1-2-3-13-1';
my $search = '-13-1';
pos = -1;
while ( ($pos=index($string, $search, $pos)) > -1 ) {
printf("found at pos %d\n", $pos++);
}
1
2
3
4
5
6
7
8
9
10
#!/usr/bin/perl
my $string = '-13-4-1-2-3-13-1-2-13-1';
my $search = '-13-1';
while($string =~ m/$search/g){
my $substr = substr $string, 0, $+[0]- length $search +1;
$substr =~ tr/-//d;
print length $substr;
}
|< 1 2 >| | 13 Einträge, 2 Seiten |