forked from Bandashah/9618-Paper-2-VB
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path960823mj16.vb
34 lines (29 loc) · 807 Bytes
/
960823mj16.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Sub Main()
Dim mystring As String
mystring = sf("hellow gOOGLE")
Console.WriteLine(" after sf " & mystring)
Console.ReadKey()
End Sub
Function sf(ByVal thisString As String) As String
Dim x As Char
Dim NewString As String
Dim flag As Boolean
Dim n, m As Integer
flag = True
NewString = ""
m = Len(thisString)
For n = 1 To m
If flag = True Then
x = UCase(Mid(thisString, n, 1))
flag = False
Else
x = LCase(Mid(thisString, n, 1))
End If
NewString = NewString & x
If x = " " Then
flag = True
End If
Next
Return NewString
End Function
End Module