Flash Vista - 主页
本周的热门 Flash 网站
The Two Tales
Site info | 档案文件
主项
主页
新进网站链接
优良评选网站
热门网站
编辑推荐
查找

Flash Tutorials
Flash Resources
FlashVista 新闻
Flash Templates
Flash Intro Templates
Website Templates
Flash Games
Flash Books
FlashVista 票选
本站图


无故定网站连结
English
Star Wars Galaxies
Site info | 找寻另一个
FlashVista
登录
注册注册
订阅电子报

新建网站链接
编修网站链接
个人喜好网站
建议新分类

打广告
支持
致谢
联落 F

Flash Templates:

More Templates ...

电子报
用户

密码



注册注册
忘记密码?
Partner websites
Free Hit Counter
Free Seo Tools
Free Tutorials
Free Video Tutorials
Forum signatures
Best Free Scripts
Wii Fit
Wii Fit News
Cool Tech Gadgets
Other Resources
推荐
推荐本站给朋友


电子报
状态: 尚未登录

Simplified Chinese English German French Spanish Italian Portuguese Russian Polish Finnish Dutch Swedish Thai Romanian Traditional Chinese Simplified Chinese
查找尚未登录
关键字: 查找:: 高级查找


Uppercase First Letter


NEW Flash Tutorials in Video Format - Powered by LearnFlash.com: 45 minutes of flash tutorials now available in streaming format or download. Topics Include flash for beginners, text effects, actionscripting, audio/video, flash 8 and more.


Printer version



by Guy Watson
www.flashguru.co.uk

Personally i feel that making the first letter of a word, in a sentence and sometimes the first letter of every word in a sentence, looks better than all lowercase. When it comes to input textfields and the loading of external content, i like to make the first letter capitalised, so i created a String method, which i use regularly and i thought i would share it...

Heres the code for the method:


String.prototype.ucFirst=function()
{
if(arguments[0] == true)
{
var words=this.split(" ")
for(var w in words)
{
words[w]=words[w].ucFirst()
}
return words.join(" ")
}
return this.charAt(0).toUpperCase()+this.substring(1,this.length)
}


And heres how you would use it:


input_title="this is my title";
title=input_title.ucFirst();
input_name="guy watson";
name=input_name.ucFirst(true);



(注册日期: 02-02-2004, 点阅人次: 0, 评比积分: 2.88, 票数: 17, 评论篇数: 1)
新建至个人喜好 建议本站给朋友

评论篇数: (1)

i love you
(注册日期: 01-10-2005 用户: 访客)


新建评论
Please note:
We review EVERY comment before it appears on the site, so please dont waste your time by posting spam links :)
No URLs allowed, no HTML please.

If you register or login first, your review will contain your nickname


评分



很棒!
非常好