[此贴子已经被作者于2006-12-7 15:39:06编辑过]
[此贴子已经被作者于2006-12-7 15:42:49编辑过]
这是用数组做的,等下有时间写个不用数组的给你。
Option Explicit
Private Sub Command1_Click()
Dim lcaseString As String
lcaseString = "this is my bbs"
Dim arrayCaseString
arrayCaseString = Split(lcaseString, " ", -1)
Dim arrayLBound As Integer
Dim arrayUBound As Integer
arrayLBound = LBound(arrayCaseString)
arrayUBound = UBound(arrayCaseString)
Dim i As Integer
For i = 0 To arrayUBound
Dim strLine As String
strLine = arrayCaseString(i)
Dim leftString As String, rightString As String
leftString = Left(strLine, 1)
rightString = Mid(strLine, 2)
leftString = UCase(leftString)
strLine = leftString & rightString
arrayCaseString(i) = strLine
Next
Dim newWord As String
For i = 0 To arrayUBound
newWord = newWord & arrayCaseString(i) & " "
Next
Print newWord
End Sub