用于大写每个单词的功能 [英] Function to capitalise each word

查看:86
本文介绍了用于大写每个单词的功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为了节省我重新发明轮子的问题,是否有人有能力将表单数据中的每个单词大写?
?我想的是

将字符串的第一个字母大写,然后是

空格或连字符后的任何其他字母。


许多用户似乎认为仅仅因为他们在线他们就可以使用像mr john smith这样的名字。所以我必须手动更改它们。

-

Nige


请用当前年份替换YYYY
非法审判暨maximus ludos,vincat

To save me re-inventing the wheel, does anyone have a function to
capitalise each word in form data? I was thinking along the lines of
capitalise the first letter of the string, then any other letter after a
space or hyphen.

So many users seem to think that just because they are online they can
use names like "mr john smith" and so I have to manually change them.
--
Nige

Please replace YYYY with the current year
ille quis mortem cum maximus ludos, vincat

推荐答案

尼日说:

除了重新发明轮子,有没有人有能力将表单数据中的每个单词大写?我正在思考
大写字母的第一个字母,然后是
空格或连字符之后的任何其他字母。

这么多用户似乎认为只是因为他们在线,他们可以使用像约翰·史密斯先生这样的名字。所以我必须手动更改它们。

To save me re-inventing the wheel, does anyone have a function to
capitalise each word in form data? I was thinking along the lines of
capitalise the first letter of the string, then any other letter after a
space or hyphen.

So many users seem to think that just because they are online they can
use names like "mr john smith" and so I have to manually change them.




无法知道一个人姓名中的哪些字母

应该是资本化。如果您的用户选择被称为

" john smith",为什么您觉得必须更改它?



There is no way of knowing which letters in a person''s name
should be capitalized. If your user chooses to be called
"john smith", why do you feel that you have to change it?


Nige写道:
为了节省我重新发明轮子,有没有人有能力将表单数据中的每个单词大写?我正在思考
大写字母串的第一个字母,然后是空格或连字符之后的任何其他字母。

这么多用户似乎认为只是因为他们在线,他们可以使用像约翰·史密斯先生这样的名字。因此我必须手动更改它们。
To save me re-inventing the wheel, does anyone have a function to
capitalise each word in form data? I was thinking along the lines of
capitalise the first letter of the string, then any other letter
after a space or hyphen.

So many users seem to think that just because they are online they can
use names like "mr john smith" and so I have to manually change them.




< p style =" text-transform:capitalize"> mr john smith< / p>




<p style="text-transform:capitalize">mr john smith</p>



2003年11月10日10:07:21 -0800,Lee< RE ************** @ cox.net>写道:
On 10 Nov 2003 10:07:21 -0800, Lee <RE**************@cox.net> wrote:
Nige说:

为了节省我重新发明轮子,有没有人有功能来每个人都有资本化表格数据中的单词?我正在思考
大写字母的第一个字母,然后是
空格或连字符之后的任何其他字母。

这么多用户似乎认为只是因为他们在线,他们可以使用像约翰·史密斯先生这样的名字。所以我必须手动更改它们。

To save me re-inventing the wheel, does anyone have a function to
capitalise each word in form data? I was thinking along the lines of
capitalise the first letter of the string, then any other letter after a
space or hyphen.

So many users seem to think that just because they are online they can
use names like "mr john smith" and so I have to manually change them.



无法知道一个人姓名中的哪些字母应该大写。如果您的用户选择被称为john smith,为什么您觉得必须更改它?



There is no way of knowing which letters in a person''s name
should be capitalized. If your user chooses to be called
"john smith", why do you feel that you have to change it?




或者诸如 Aravinda de Silva如果你使用De,你会得到这个名字

完全错误。


吉姆。


-

comp.lang.javascript常见问题 - http:// jibbering。 com / faq /



Or people such as "Aravinda de Silva" who you''d be getting the name
completely wrong if you use De.

Jim.

--
comp.lang.javascript FAQ - http://jibbering.com/faq/


这篇关于用于大写每个单词的功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆