| 
	
 | 
 Posted by Kimmo Laine on 08/31/06 12:54 
I have abunch of names that I'd like to normalize case-wise. Some are  
lowercase (joe jackson), some uppercase (JOE JACKSON), and some correctly  
cased (Joe Jackson). ucfirst(strtolower('JOE JACKSON')); works for most  
cases, but if there's a name with a hyphen, ie. BILLY-BOB JOHNSON and  
jack-bob johnson and Bob-Bob Johnson, they're turned into Billy-bob etc...  
The letter after the hyphen should be uppercased as well, not just the ones  
after space. Anyone got idea how to do this? 
 
(Then there are names like McGyver or MacCartney and O'Reilly... But that's  
okay, we have so few of this kind of names in Finland it doesn't matter.) 
 
--  
"Ohjelmoija  on  organismi  joka  muuttaa  kofeiinia  koodiksi" - lpk 
http://outolempi.net/ahdistus/ - Satunnaisesti pδivittyvδ nettisarjis 
spam@outolempi.net || Gedoon-S @ IRCnet || rot13(xvzzb@bhgbyrzcv.arg)
 
  
Navigation:
[Reply to this message] 
 |