![]() |
![]() |
![]() |
![]() |
![]() ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() ![]() |
供应求购 | 免费商铺 | 商业资讯 | 库存二手 | 黄页大全 | 生活贴吧 | 房屋租售 | 招聘求职 | 婚恋交友 | 自助广告 |
asp转换字符串单词的第一个字母为大写 | ||
发布时间:2011/1/22 9:49:17 发布人:qqqqqq 点击:190 | ||
Description: You know how to use UCase and LCase, now here's Pcase! Ucase converts a string to all UPPERCASE, and of course Lcase does the opposite, but this will convert any text string to Proper Case. It basically capitalizes the first letter of every word in the string. Pretty cool, huh?! Copy and paste this snippet as-is into your editor: <% Function PCase(strInput) iPosition = 1 Do While InStr(iPosition, strInput, " ", 1) <> 0 iSpace = InStr(iPosition, strInput, " ", 1) strOutput = strOutput & UCase(Mid(strInput, iPosition, 1)) strOutput = strOutput & LCase(Mid(strInput, iPosition + 1, iSpace - iPosition)) iPosition = iSpace + 1 Loop strOutput = strOutput & UCase(Mid(strInput, iPosition, 1)) strOutput = strOutput & LCase(Mid(strInput, iPosition + 1)) PCase = strOutput End Function %> <html><body> Then, in your asp, use the function like this:<br> i.e.: <%=PCase(rs("PG"))%> or..<br> i.e.: <%=PCase(myVariable)%> etc etc etc..<br> </body></html> |
||
![]() |
![]() |
![]() |
※ | 发布回复 | ↓请遵循123发布网同城生活贴吧/论坛发帖规则;↓寻一夜情、包养、招嫖类信息的一律全部删除,并报公安备案↓ | |
|
![]() |
![]() |
网站首页 | 关于我们 | 广告业务 | 关于VIP | 免责声明 | 联系我们 | 设为首页 | 加入收藏 | 意见反馈 | 网站建设 |
123发布网 版权所有 www.123fbw.com 联系电话:18331151646 QQ:1016964448
CopyRight © 2007-2016 All Right Reserved 联系站长 津ICP备10002728号 统计: |