PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.php > How to detect if there is more then one capital letter in a word
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
How to detect if there is more then one capital letter in a word

Réponse
 
LinkBack Outils de la discussion
Vieux 14/09/2007, 12h03   #1
Moham12345
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut How to detect if there is more then one capital letter in a word

How can i detect if there is more then capital letter in a word?

  Réponse avec citation
Vieux 14/09/2007, 12h10   #2
Moham12345
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: How to detect if there is more then one capital letter in a word

On 14 Sep, 12:03, Moham12345 <m_w_r...@hotmail.com> wrote:
> How can i detect if there is more then capital letter in a word?


sorry i think i did a typo just above... i was meant to say...

How can i detect more then one capital letter in a word?

  Réponse avec citation
Vieux 14/09/2007, 12h13   #3
Captain Paralytic
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: How to detect if there is more then one capital letter in a word

On 14 Sep, 12:10, Moham12345 <m_w_r...@hotmail.com> wrote:
> On 14 Sep, 12:03, Moham12345 <m_w_r...@hotmail.com> wrote:
>
> > How can i detect if there is more then capital letter in a word?

>
> sorry i think i did a typo just above... i was meant to say...
>
> How can i detect more then one capital letter in a word?


I think you were right the first time!

  Réponse avec citation
Vieux 14/09/2007, 12h44   #4
gosha bine
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: How to detect if there is more then one capital letter in a word

On 14.09.2007 13:10 Moham12345 wrote:
> On 14 Sep, 12:03, Moham12345 <m_w_r...@hotmail.com> wrote:
>> How can i detect if there is more then capital letter in a word?

>
> sorry i think i did a typo just above... i was meant to say...
>
> How can i detect more then one capital letter in a word?
>



many possibilities, for example

preg_match_all('/[A-Z]/', $str, $m);
$num_up = count($m[0]);

or

$num_up = strlen($str) - strlen(preg_replace('/[A-Z]/', '', $str));

or

$num_up = levenshtein($str, strtolower($str));


where $str is your string and $num_up is a number of uppercase letters
in it.




--
gosha bine

makrell ~ http://www.tagarga.com/blok/makrell
php done right http://code.google.com/p/pihipi
  Réponse avec citation
Vieux 14/09/2007, 14h13   #5
Rik Wasmus
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: How to detect if there is more then one capital letter in a word

On Fri, 14 Sep 2007 13:44:04 +0200, gosha bine <stereofrog@gmail.com>
wrote:

> On 14.09.2007 13:10 Moham12345 wrote:
>> On 14 Sep, 12:03, Moham12345 <m_w_r...@hotmail.com> wrote:
>>> How can i detect if there is more then capital letter in a word?

>> sorry i think i did a typo just above... i was meant to say...
>> How can i detect more then one capital letter in a word?
>>

>
>
> many possibilities, for example
>
> preg_match_all('/[A-Z]/', $str, $m);
> $num_up = count($m[0]);



Let's summarize by $num_up = preg_match_all('/[A-Z]/', $str, $m);

--
Rik Wasmus
  Réponse avec citation
Vieux 14/09/2007, 14h24   #6
gosha bine
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: How to detect if there is more then one capital letter in a word

On 14.09.2007 15:13 Rik Wasmus wrote:
> On Fri, 14 Sep 2007 13:44:04 +0200, gosha bine <stereofrog@gmail.com>
> wrote:
>
>> On 14.09.2007 13:10 Moham12345 wrote:
>>> On 14 Sep, 12:03, Moham12345 <m_w_r...@hotmail.com> wrote:
>>>> How can i detect if there is more then capital letter in a word?
>>> sorry i think i did a typo just above... i was meant to say...
>>> How can i detect more then one capital letter in a word?
>>>

>>
>>
>> many possibilities, for example
>>
>> preg_match_all('/[A-Z]/', $str, $m);
>> $num_up = count($m[0]);

>
>
> Let's summarize by $num_up = preg_match_all('/[A-Z]/', $str, $m);
>


Yes. I find it utterly stupid that you can't omit the third param for
the cases like this.


--
gosha bine

makrell ~ http://www.tagarga.com/blok/makrell
php done right http://code.google.com/p/pihipi
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 22h46.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,09972 seconds with 14 queries