--0OWHXb1mYLuhj1Ox
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sun, Jul 22, 2007 at 07:15:50AM -0000, hamann.w@t-online.de wrote:
> Mark Perkel wrote:
> If I have a string, what's that fastest way to count the number of=20
> periods in the string?
>=20
> in perl, I would probably split the string at the periods
>=20
> @parts =3D split /\./, $string;
> and then just use the number of splits
> $#parts


I believe the official/fastest/shortest method is:

$count =3D $string =3D~ y/.//;

--=20
Randomly Selected Tagline:
If a can of Alpo costs 38 cents, would it cost $2.50 in Dog Dollars?

--0OWHXb1mYLuhj1Ox
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQFGowyFamwUIkXWD1cRAmBvAKDvWdTooGIUDVtiM2oIym p4m5w0WACgmaFw
VKPxj2yAufqs7Vae6RPNFJw=
=7ppd
-----END PGP SIGNATURE-----

--0OWHXb1mYLuhj1Ox--