0

Hi
i need help in changing a character case for exaple i have a textbox i want that when i write a word it should change case by character to character like : if i write " case " then text box should display " cAsE "

4
Contributors
3
Replies
5
Views
7 Years
Discussion Span
Last Post by crapulency
0
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
        TextBox1.Text = TextBox1.Text.Replace("case", "cAsE")
    End Sub
0
Private Function AlternateCase(ByVal Input As String) As String
        Dim sResult As String = ""
        Dim sChar As String = ""
        Dim i As Integer
        Dim capital As Boolean = True
        For i = 0 To Input.Length - 1
            capital = Not capital
            sChar = Input.Substring(i, 1)
            If capital Then
                sResult &= sChar.ToUpper
            Else
                sResult &= sChar.ToLower
            End If
        Next
        Return sResult
    End Function
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.