pike.ida.liu.se
Search for
Home > Docs > Pike reference

[Top]
String

String.count()


Method count

int count(string haystack, string needle)

Description

Count the number of non-overlapping times the string needle occurs in the string haystack . The special cases for the needle "" is that it occurs one time in the empty string, zero times in a one character string and between every character (length-1) in any other string.

See also

search() , `/()

Module reference for Pike v7.8 release 116, 2008-12-31