作业帮 > 英语 > 作业

将一个英文句子每个单词的首字母变成大写,VB?

来源:学生作业帮 编辑:百度作业网作业帮 分类:英语作业 时间:2024/05/07 17:03:40
将一个英文句子每个单词的首字母变成大写,VB?
EG:I am a teacher.
明天考试急用!
将一个英文句子每个单词的首字母变成大写,VB?
Dim JZ As String
JZ = "As long as there is a reasonable possibility,we will ask you to provide personal information to you the right to choose.You can serve in the specific privacy statement or the FAQ to find out more about your right to choose the information."
TT = Split(JZ)
JZ = ""
For i = 0 To UBound(TT)
If Len(JZ) = 0 Then
JZ = UCase(Left(TT(i),1)) & Mid(TT(i),2)
Else
JZ = JZ & " " & UCase(Left(TT(i),1)) & Mid(TT(i),2)
End If
Next
MsgBox JZ