CamelCase in Basic

Example for versions VBScript 5.7, VBScript 5.8

Unlike many other Visual Basic versions, VBScript has no StrConv function. In the end character-by-character processing of the string turns out to be easier.

Text = LCase(WScript.StdIn.ReadLine)
CamelCase = ""
WasSpace = True
For i = 1 To Len(Text)
  Ch = Mid(Text, i, 1)
  If InStr("abcdefghijklmnopqrstuvwxyz", Ch) = 0 Then
    WasSpace = True
  Else
    If WasSpace Then
      CamelCase = CamelCase & UCase(Ch)
    Else
      CamelCase = CamelCase & Ch
    End If
    WasSpace = False
  End If
Next
WScript.Echo CamelCase