Re: Count the occurence of a character

2004-07-24 Thread John W. Krahn
David Storrs wrote: On Fri, Jul 23, 2004 at 12:13:48PM +0200, Paul Johnson wrote: On Fri, Jul 23, 2004 at 03:12:22PM +0530, Jaffer Shaik wrote: I have the below strig $str = "abckdweqadidkisdikda"; In the above string, I want to count the occurrences of character 'a', i.e I should get count of

Re: Count the occurence of a character

2004-07-24 Thread David Storrs
On Fri, Jul 23, 2004 at 12:13:48PM +0200, Paul Johnson wrote: > On Fri, Jul 23, 2004 at 03:12:22PM +0530, Jaffer Shaik wrote: > > > I have the below strig > > > > $str = "abckdweqadidkisdikda"; > > > > In the above string, I want to count the occurrences of character 'a', > > i.e I should g

Re: Count the occurence of a character

2004-07-23 Thread Paul Johnson
On Fri, Jul 23, 2004 at 03:12:22PM +0530, Jaffer Shaik wrote: > I have the below strig > > $str = "abckdweqadidkisdikda"; > > In the above string, I want to count the occurrences of character 'a', > i.e I should get count of a = 7. > > How can i achieve this in Perl. $count = $str =~ tr/a/

Re: Count the occurence of a character

2004-07-23 Thread Remo Sanges
On Jul 23, 2004, at 11:42 AM, Jaffer Shaik wrote: $str = "abckdweqadidkisdikda"; In the above string, I want to count the occurrences of character 'a', i.e I should get count of a = 7. How can i achieve this in Perl. @a=$str=~m/a/g; print scalar(@a)."\n"; Remo -- To unsubscribe, e-mail: [EMAIL

Count the occurence of a character

2004-07-23 Thread Jaffer Shaik
Dear Friends, I have the below strig $str = "abckdweqadidkisdikda"; In the above string, I want to count the occurrences of character 'a', i.e I should get count of a = 7. How can i achieve this in Perl. Thank you, Jaffer. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional comma