String functions

Lars Hansen lhansen at adobe.com
Thu Apr 10 10:30:44 PDT 2008


> -----Original Message-----
> From: es4-discuss-bounces at mozilla.org 
> [mailto:es4-discuss-bounces at mozilla.org] On Behalf Of Keryx Web
> Sent: 10. april 2008 10:59
> To: es4-discuss at mozilla.org
> Subject: String functions
> 
> Hi all!
> 
> I am new to this list and perhaps my questions have been 
> answered. If so, could anyone point me to those discussions.
> 
> I see that string.trim is part of the suggested spec. Coming 
> from PHP the thing I miss the most when programming 
> JavaScript is the plethora of string functions, and the 
> printf family of functions.
> 
> Besides trim, I have not been able to see any suggestions.

There are no other accepted proposals for extending the set of
string functions, apart from making some string methods also
available as static methods on the string class (since they
are generic anyhow).

> My questions: What string functions have been discussed? Are 
> there any more that might make it? If I provide my use case, 
> might a new function be considered for inclusion?

Not likely at this date, but you can always try.

> Have the printf/sprintf been considered for inclusion? 

Similar functions have been considered, and rejected.  Curiously,
I can't find writeups of the rejected proposals now.

(Don't know what you would do with printf() since there's no
stdout.)

> If so, 
> with named parameters as in Python (which I do miss in PHP)?
> 
> The functions I personally miss the most are:
> - ucfirst
> - number_format
> - sha1
> - levenshtein

Presumably one of the formatting functions on Number will suit
you for number_format; the others are probably out of the
question.

> As well as ltrim and rtrim, but I see that they are being 
> discussed on the wiki.

But are not included in the spec.

--lars



More information about the Es4-discuss mailing list