Re: Counting characters in a thread

2004-08-15 Thread Zeus Odin
The fastest would probably be: $text = '' if $text =~ tr/%// > 10; -ZO <[EMAIL PROTECTED]> wrote ... > How would I empty $string if it contained more than ten % characters? In > other words -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: AW: Counting characters in a thread

2004-07-09 Thread John W . Krahn
On Friday 09 July 2004 04:31, Bastian Angerstein wrote: > > unless ($string =~ /%{0,10}/) { > $string = undef; > } That will only work if the % characters are all next to each other. perldoc -q "How can I count the number of occurrences of a substring within a string" John -- use Perl; progr

Re: Counting characters in a thread

2004-07-09 Thread John W . Krahn
On Friday 09 July 2004 04:26, Ricardo SIGNES wrote: > * [EMAIL PROTECTED] [2004-07-09T07:20:57] > > > How would I empty $string if it contained more than ten % > > characters? In other words > > $string = "" if split(/%/, $string) > 10; That will produce the warning: Use of implicit split to @_ is

Re: Counting characters in a thread

2004-07-09 Thread John W . Krahn
On Friday 09 July 2004 04:20, [EMAIL PROTECTED] wrote: > $string = > "a%3A2%3A%7Bi%3A0%3Bs%3A3%3A%22489%22%3Bi%3A1%3Bs%3A32%3A%22a85a44c18 >81523798bc155a5369e1226%22%3B%7D" > > How would I empty $string if it contained more than ten % characters? > In other words > > $string = > "a%3A2%3A%7Bi%3A0%

AW: Counting characters in a thread

2004-07-09 Thread Bastian Angerstein
unless ($string =~ /%{0,10}/) { $string = undef; } -Ursprungliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 9. Juli 2004 13:21 An: [EMAIL PROTECTED] Betreff: Counting characters in a thread $string = "a%3A2%3A%7Bi%3A0%3Bs%3A3%3A%22489%2

Re: Counting characters in a thread

2004-07-09 Thread Ricardo SIGNES
* [EMAIL PROTECTED] [2004-07-09T07:20:57] > How would I empty $string if it contained more than ten % characters? In > other words $string = "" if split(/%/, $string) > 10; -- rjbs pgpO8nLAuJ7WJ.pgp Description: PGP signature

Counting characters in a thread

2004-07-09 Thread Jimstone77
$string = "a%3A2%3A%7Bi%3A0%3Bs%3A3%3A%22489%22%3Bi%3A1%3Bs%3A32%3A%22a85a44c1881523798bc155a5369e1226%22%3B%7D" How would I empty $string if it contained more than ten % characters? In other words $string = "a%3A2%3A%7Bi%3A0%3Bs%3A3%3A%22489%22%3Bi%3A1%3Bs%3A32%3A%22a85a44c1881523798bc155a53