[Gambas-user] Boxed string question

Benoît Minisini g4mba5 at gmail.com
Wed Sep 11 18:18:32 CEST 2019


Le 11/09/2019 à 15:44, Gianluigi a écrit :
> Hi Cedron,
> thank you very much for all the suggestions ;-)
> 
> Regards
> Gianluigi
> 

Why the name "ProperCase"?

Anyway, it's difficult to add a function that should behave differently 
according to the current language (the proper case is not the same thing 
in French, Italian, and I don't tell about Chinese and Arabic), if that 
information is not available in the libc.

The right name would be "String.CapitalizeWords".

And String.UCaseFirst() should have been named String.Capitalize().

As for Cedric's suggestion, ('HomeAddress' <==> 'home_address'), it a 
good idea too. The generic name for that sort of things is "normalization".

But if you normalize for database you should put the function in the 
database component. Which has, by the way, quoting functions that should 
allow to name your identifiers as you want.

Regards,

-- 
Benoît Minisini


More information about the User mailing list