转换字符串单词的第一个字母为大写
发布时间:2007-10-18 10:50:00
标签:大写,字符串
本文介绍了一种将英文字符首个字母串转换为大写的asp代码,当然这个功能可能英文网站比较有用。
转换大写功能英文介绍:
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:
实现转换大写的asp函数代码:
<%
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>
转换字符串单词的第一个字母大写使用方法:<br>
读取数据库字段例子: <%=PCase(rs("PG"))%> <br>
读取asp参数.: <%=PCase(myVariable)%> <br>
直接写入字符串.: <%=PCase("asp之家 www.aspxhome.com")%> <br>
</body></html>
0
投稿
猜你喜欢
- 目录prometheus通过exporter监控mysql,并用grafana图表展示1、测试机器 2、配置mysql host0
- 一、Beautiful Soup的介绍Beautiful Soup是一个强大的解析工具,它借助网页结构和属性等特性来解析网页。它提供一些函数
- python发送icmp echo requesy请求import socketimport structdef checksum(sour
- 在完成了应用程序架构和页面的设计后,我们可以开始探讨如何实现多种多样的普通数据到报表展现的任务。前面我们已经了解到如何在从数据访问层和业务逻
- 今天星期天,因数据库太慢,最后决定将数据库进行重新整理. (假定数据库名称为:DB_ste) 1、根据现在的数据库的脚本创建一个脚本文件(F
- 以下备忘升级至 Vue CLI 3.x 版本后,将项目目录改为新结构时所需做的一些改动。1. 卸载与安装npm uninstall vue-
- 上一篇 我们学习了简单的Python TCP Socket 编程,通过分别写服务端和客户端的代码了解基本的 Python Socket 编程
- 网页中的javascript脚本代码往往需要在文档加载完成后才能够去执行,否则可能导致无法获取对象的情况,为了避免这种情况的发生,可以使用以
- Python常见的异常提示及含义对照表如下:异常名称描述BaseException所有异常的基类SystemExit解释器请求退出Keybo
- 在向大家详细介绍Linux mysql之前,首先让大家了解下Linux mysql,然后全面介绍Linux mysql,希望对大家有用。1.
- 目的是想通过给定一个ID,取出所有的子ID,包括子ID的子ID。一开始写成FUNCTION,因为FUNCTION调用方便,但是报错:ERRO
- 发现一个很简单的配置方法,一直想写的没写上,今天抽空就把它给补充完整好了。本文的配置方法Windows,Mac和Linux系统均适合。一.安
- 一、_func 单下划线开头 --口头私有变量1.1、在模块中使用单下划线开头在Python中,通过单下划线_来实现模块级别的私有化,变量除
- 获取DataFrame虽然是一个比较简单的操作,但是有时候到手边就是写不出来,所以在这里总结记录一下:1.链表推倒式data =
- 只做简单地记录,方便一下使用!python关于csv模块的介绍网上有很多资料,这里就不在赘诉。直接给出代码和解释。数据:Symbol,Pri
- 大部分情况下,这种动态生成的sql查询语句写法如下: 代码如下:select A表.字段1,A表.字段2,B表.字段返回,C表.字段返回 f
- 本文实例分析了Go语言中的指针运算方法。分享给大家供大家参考。具体分析如下:Go语言的语法上是不支持指针运算的,所有指针都在可控的一个范围内
- js阻止浏览器默认行为的简单实例<!DOCTYPE html><html> <head> &
- 本文实例讲述了python文件读写操作与linux shell变量命令交互执行的方法。分享给大家供大家参考。具体如下:python对文件的读
- python去除列表中的空值元素实战技巧产生需求的原因:最近都在使用python做一些小demo,尤其是经常会用python做一些关于数据处