You are here: Re: [PHP] Re: Testing a String for 'most' Capitalised « PHP « IT news, forums, messages
Re: [PHP] Re: Testing a String for 'most' Capitalised

Posted by "Richard Lynch" on 10/10/05 23:32

On Mon, October 10, 2005 12:31 pm, zzapper wrote:
> On Mon, 10 Oct 2005 15:27:05 +0100, wrote:
>
>>On 10/10/05, zzapper <david@tvis.co.uk> wrote:
>>> Hi,
>>>
>>> Image that there could be a string
>>>
>>> fred
>>> Fred
>>> FRED
>>>
>>> First of all I need to know that these are same which I can do with
>>> strtolower, but how could I tell
>>> that 'FRED' is 'most captilised?
>
> Thanx 4 various replies. In fact speed is more important 4 me than
> exactitude as it's right inside a
> critical loop.
>
> I think strcmp will do the biz even though it sees fred as being
> greater than Fred ?!?

A = 65
B = 66
C = 67
..
..
..

a = 120 (?)
b = 121 (?)
c = 122 (?)
..
..
..

f > F
a > A
fred > Fred > FRED

The "smallest" string is the "most capitalized", assuming they are the
same in lowercase.

--
Like Music?
http://l-i-e.com/artists.htm

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация