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