Thread substr_count in perl (29 answers)
Opened by norman at 2004-07-14 14:52

betterworld
 2004-07-14 15:02
#84289 #84289
User since
2003-08-21
2614 Artikel
ModeratorIn

user image
Ja.
Code: (dl )
1
2
3
4
5
my $string = "abba";
my $substr_count = $string =~ y/a/a/;

#oder auch:
my $substr_count_2 = @{[$string =~ m/(a)/g)]};

Die erste Form funktioniert nur, wenn "a" nur ein einziger Buchstabe ist.\n\n

<!--EDIT|betterworld|1089803224-->

View full thread substr_count in perl