A function that turns the first letter of the English word in the title of the article to uppercase
Source: Internet
Author: User
Function Description:
You can turn the initials of the English words in the title of the article into uppercase:
<%
function Pcase (strinput)
' Variable declaration.
Dim Strarr
Dim Tmpword
Dim tmpstring
Dim Last
"Create an array to store" Each word in the String separately.
Strarr = Split (Strinput, "")
If UBound (Strarr) > 0 Then
For x = LBound (Strarr) To UBound (Strarr)
' Set each word to lower the case initially.
Strarr (x) = LCase (Strarr (x))
' Skip the unimportant words.
Select case Strarr (x)
Case "a"
Case "a"
Case "and"
Case "but"
Case "by"
Case "for"
Case "in"
Case "into"
Case ' is '
Case "of"
Case "Off"
Case "on"
Case "onto"
Case "or"
Case "the"
Case "to"
Case "a.m."
Strarr (x) = "a.m."
Case "p.m."
Strarr (x) = "p.m."
Case "B.C."
Strarr (x) = "B.C."
Case "A.D."
Strarr (x) = "A.D."
Case Else
' Capitalize the ', but don ' t forget to take
' The String may is in single or Double quotes.
If Len (Strarr (x)) > 1 Then
If Mid (Strarr (x), 1,1) = "'" or mid (Strarr (x), 1,1) = "" "Then
Tmpword = Mid (Strarr (x), 1,1) & Ucase (Mid (Strarr (x), 2,1)) & Mid (Strarr (x), 3,len (Strarr (x))-2)
Else
Tmpword = Ucase (Mid (Strarr (x), 1,1)) & Mid (Strarr (x), 2,len (Strarr (x))-1)
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.