登录123 | 账号: 密码: 今天是: 加入收藏 返回首页 

同城供应求购,商机就在身边 免费企业商铺,免费发布商机 关注商业资讯,把握商业机会 同城库存二手,晒出您的宝贝,淘进新的宝贝
全国企业黄页大全,加入即可得到推广
返回同城123首页
同城123信息网,最全最专业的同城分类信息网
同城生活贴吧,贴出生活的精彩 同城房屋租售,卖房、买房、租房、出租 同城招聘求职,优秀人才/高薪岗位等您来 同城婚恋交友,寻找你的TA
免费无极限,广告任意发
供应求购 免费商铺 商业资讯 库存二手 黄页大全 生活贴吧 房屋租售 招聘求职 婚恋交友 自助广告

asp转换字符串单词的第一个字母为大写
发布时间:2011/1/22 9:49:17 发布人:qqqqqq 点击:190
Code Title: Proper Case
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发布网广告位【218】 123发布网广告位【219】
 ※ 发布回复   ↓请遵循123发布网同城生活贴吧/论坛发帖规则;↓寻一夜情、包养、招嫖类信息的一律全部删除,并报公安备案↓  
回复标题:  
回复内容:
上传图片:
验 证 码:  

123发布网广告位【220】 123发布网广告位【221】
网站首页 | 关于我们 | 广告业务 | 关于VIP | 免责声明 | 联系我们 | 设为首页 | 加入收藏 | 意见反馈 | 网站建设
123发布网 版权所有 www.123fbw.com  联系电话:18331151646  QQ:1016964448
 CopyRight © 2007-2016 All Right Reserved  联系站长  津ICP备10002728号  统计: