By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,952 Members | 1,935 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,952 IT Pros & Developers. It's quick & easy.

Formatting function

P: n/a
CK
Is there an easy javascript function that takes a string and returns a
properly formatted string?

Like "john smith" would be "John Smith".

Any ideas? In vbScript there is a vbProperCase constant used with their
formatting function. Is there something simliar in javascript?

Thanks to everyone who replies,
Chris
Jan 9 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
CK wrote on 09 jan 2006 in comp.lang.javascript:
Is there an easy javascript function that takes a string and returns a
properly formatted string?

Like "john smith" would be "John Smith".


This has been covered in this NG in 2003, see the archive.

<http://groups.google.com/group/micro...sp.general/bro
wse_frm/thread/6dde9f112289d86/4385df9a5e0459c9>

or

<http://tinyurl.com/behgp>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jan 9 '06 #2

P: n/a
CK said the following on 1/9/2006 4:14 PM:
Is there an easy javascript function that takes a string and returns a
properly formatted string?

Like "john smith" would be "John Smith".


I don't think Peter O'Malley or John deGaulle would agree with that
correction.

Let users enter it the way they want and then let them suffer any and
all consequences.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jan 9 '06 #3

P: n/a
CK
Thanks man! That'll work.

CK

"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn********************@194.109.133.242...
CK wrote on 09 jan 2006 in comp.lang.javascript:
Is there an easy javascript function that takes a string and returns a
properly formatted string?

Like "john smith" would be "John Smith".


This has been covered in this NG in 2003, see the archive.

<http://groups.google.com/group/micro...sp.general/bro
wse_frm/thread/6dde9f112289d86/4385df9a5e0459c9>

or

<http://tinyurl.com/behgp>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Jan 9 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.