Sub Activity_Create(FirstTime As Boolean)
Dim s As String
s = ToMixCase("some string value")
MsgBox(s, "")
End Sub
Sub ToMixCase(Entry As String) As String
Dim sb As StringBuilder
Dim m As Matcher
Dim I As Int
Entry = Entry.ToLowerCase
sb.Initialize
m = Regex.Matcher("(^\w)|(\s\w)", Entry)
Do While m.Find
If m.Match.Length > 1 Then
sb.Append(Entry.SubString2(I, m.GetStart(0) + 1))
sb.Append(m.Match.SubString(1).ToUpperCase)
Else
sb.Append(Entry.SubString2(I, m.GetStart(0)))
sb.Append(m.Match.ToUpperCase)
End If
I = m.GetEnd(0)
Loop
If I < Entry.Length Then
sb.Append(Entry.SubString(I))
End If
Return sb.ToString
End Sub