Thread Index Suche ohne Vorzeichen? (12 answers)
Opened by wandasia at 2006-10-13 15:12

renee
 2006-10-13 16:46
#70762 #70762
User since
2003-08-04
14371 Artikel
ModeratorIn
[Homepage] [default_avatar]
Das hier sollte noch funktionieren:
Code: (dl )
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;
}
OTRS-Erweiterungen (http://feature-addons.de/)
Frankfurt Perlmongers (http://frankfurt.pm/)
--

Unterlagen OTRS-Workshop 2012: http://otrs.perl-services.de/workshop.html
Perl-Entwicklung: http://perl-services.de/

View full thread Index Suche ohne Vorzeichen?