'10'.makePlural('lad', 'y', 'ies') == 1 ladies

should have been

'10'.makePlural('lad', 'y', 'ies') == 10 ladies


On 12/03/07, Richard Quadling <[EMAIL PROTECTED]> wrote:
> 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.
>
> 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 do see that this would be an issue for foreign speakers. The
> cleanest solution would be to always supply the suffixes and to always
> append them to the output, supplied or blank.
>
>
>
> On 12/03/07, Tom Gregory <[EMAIL PROTECTED]> wrote:
> >
> > trim already exists under the name "strip" (taken from Ruby).
> >
> > You may wish to consider the international nature of prototype when
> > proposing functions like makePlural or addCommas.
> >
> >
> > TAG
> >
> > On Mar 12, 2007, at 2:59 AM, Richard Quadling wrote:
> >
> > > Hi.
> > >
> > > Great to see some new functionality in prototype.
> > >
> > > I have a question about the position of the new toPaddedString method
> > > for the Number class.
> > >
> > > Shouldn't you have the pad method as part of the String class?
> > >
> > > I would like to contribute some new String methods
> > >
> > > String.Chr, String.Asc, String.prototype.addCommas,
> > > String.prototype.left/mid/right, String.prototype.lTrim/trim/rTrim,
> > > String.prototype.makePlural, String.prototype.pad
> > >
> > > I've attached my code. It may be of use to you. As own pad method
> > > names are different, I'm not in any trouble with a name conflict.
> > >
> > > Regards,
> > >
> > > Richard Quadling.
> > > --
> > > -----
> > > Richard Quadling
> > > Zend Certified Engineer : http://zend.com/zce.php?
> > > c=ZEND002498&r=213474731
> > > "Standing on the shoulders of some very clever giants!"
> > >
> > > >
> > > <enhanced_string.js>
> >
> >
> > > >
> >
>
>
> --
> -----
> Richard Quadling
> Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
> "Standing on the shoulders of some very clever giants!"
>


-- 
-----
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
"Standing on the shoulders of some very clever giants!"

--~--~---------~--~----~------------~-------~--~----~
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