问题标题:
输入一些英文语句,使每个单词的第一个字母变成大写VB写
问题描述:
输入一些英文语句,使每个单词的第一个字母变成大写
VB写
高宇回答:
标点符号你还可以添加
PrivateSubCommand1_Click()
Dima,a1,s1,s2,b()
f=Array(",",",".",":",";","!")
a=Text1
Forj=0ToUBound(f)
a1=Split(a,f(j))
ReDimb(UBound(a1))
Fori=0ToUBound(a1)
s1=Left(a1(i),1)
s1=UCase(s1)
s2=Right(a1(i),Len(a1(i))-1)
b(i)=s1&s2
Nexti
Fori=0ToUBound(a1)
txt=txt&b(i)&f(j)
Nexti
a=Left(txt,Len(txt)-1)
txt=""
Nextj
Text1=a
EndSub
PrivateSubForm_Load()
Text1="sad,aaa?bd!fds;sdf:sdf"
EndSub
点击显示
其它推荐
热门其它推荐