Am 12.03.2007 um 18:12 schrieb Richard Quadling:

>
> strip only removes leading and trailing spaces.
>
> I DO see though, that the regex version is a little nicer to read and
> I'll be see if it is faster than the string manip version I have.
>
> trim/ltrim/rtrim allow for arbitrary characters to be removed,
> removing quotes or dot, etc.

Just use gsub. I don't think adding methods like these adds too much  
value here.

>
> makePlural and addCommas are both currently English (i.e. s is for
> Plural, cat/cats).
>
> You can use alternative plurals...
>
> '10'.makePlural('box', '', 'es') == 10 boxes
> '1'.makePlural('lad', 'y', 'ies') == 1 lady
> '10'.makePlural('lad', 'y', 'ies') == 1 ladies
>
> So, you can supply your own appropriate single/plural suffix.
>
> As there is no standard, even in english, I took the normal english  
> version.

I can imagine some version of the Rails pluralize helper added, but  
without the magic Inflector stuff Rails does.

Here's the API docs for that one:
http://api.rubyonrails.org/classes/ActionView/Helpers/ 
TextHelper.html#M000618

You'll notice that some of the other methods are already implemented  
in Prototype.

Best,
Thomas

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to