Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Function WeirdCase(input As String)
- Dim output As String() = {""}
- For i As Integer = 1 To input.Length
- If input(i - 1) = "a" Then
- If i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("A")
- output = list.ToArray()
- Else
- If Not i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("a")
- output = list.ToArray()
- End If
- End If
- Else
- If input(i - 1) = "A" Then
- If i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("A")
- output = list.ToArray()
- Else
- If Not i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("a")
- output = list.ToArray()
- End If
- End If
- End If
- End If
- If input(i - 1) = "b" Then
- If i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("B")
- output = list.ToArray()
- Else
- If Not i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("b")
- output = list.ToArray()
- End If
- End If
- Else
- If input(i - 1) = "B" Then
- If i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("B")
- output = list.ToArray()
- Else
- If Not i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("b")
- output = list.ToArray()
- End If
- End If
- End If
- End If
- If input(i - 1) = "c" Then
- If i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("C")
- output = list.ToArray()
- Else
- If Not i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("c")
- output = list.ToArray()
- End If
- End If
- Else
- If input(i - 1) = "C" Then
- If i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("C")
- output = list.ToArray()
- Else
- If Not i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("c")
- output = list.ToArray()
- End If
- End If
- End If
- End If
- If input(i - 1) = "d" Then
- If i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("D")
- output = list.ToArray()
- Else
- If Not i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("d")
- output = list.ToArray()
- End If
- End If
- Else
- If input(i - 1) = "D" Then
- If i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("D")
- output = list.ToArray()
- Else
- If Not i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("d")
- output = list.ToArray()
- End If
- End If
- End If
- End If
- If input(i - 1) = "e" Then
- If i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("E")
- output = list.ToArray()
- Else
- If Not i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("e")
- output = list.ToArray()
- End If
- End If
- Else
- If input(i - 1) = "E" Then
- If i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("E")
- output = list.ToArray()
- Else
- If Not i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("e")
- output = list.ToArray()
- End If
- End If
- End If
- End If
- If input(i - 1) = "f" Then
- If i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("F")
- output = list.ToArray()
- Else
- If Not i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("f")
- output = list.ToArray()
- End If
- End If
- Else
- If input(i - 1) = "E" Then
- If i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("F")
- output = list.ToArray()
- Else
- If Not i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("f")
- output = list.ToArray()
- End If
- End If
- End If
- End If
- If input(i - 1) = "g" Then
- If i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("G")
- output = list.ToArray()
- Else
- If Not i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("g")
- output = list.ToArray()
- End If
- End If
- Else
- If input(i - 1) = "G" Then
- If i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("G")
- output = list.ToArray()
- Else
- If Not i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("g")
- output = list.ToArray()
- End If
- End If
- End If
- End If
- If input(i - 1) = "h" Then
- If i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("H")
- output = list.ToArray()
- Else
- If Not i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("h")
- output = list.ToArray()
- End If
- End If
- Else
- If input(i - 1) = "H" Then
- If i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("H")
- output = list.ToArray()
- Else
- If Not i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("h")
- output = list.ToArray()
- End If
- End If
- End If
- End If
- If input(i - 1) = "i" Then
- If i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("I")
- output = list.ToArray()
- Else
- If Not i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("i")
- output = list.ToArray()
- End If
- End If
- Else
- If input(i - 1) = "I" Then
- If i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("I")
- output = list.ToArray()
- Else
- If Not i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("i")
- output = list.ToArray()
- End If
- End If
- End If
- End If
- If input(i - 1) = "j" Then
- If i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("J")
- output = list.ToArray()
- Else
- If Not i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("j")
- output = list.ToArray()
- End If
- End If
- Else
- If input(i - 1) = "J" Then
- If i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("J")
- output = list.ToArray()
- Else
- If Not i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("j")
- output = list.ToArray()
- End If
- End If
- End If
- End If
- If input(i - 1) = "j" Then
- If i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("J")
- output = list.ToArray()
- Else
- If Not i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("j")
- output = list.ToArray()
- End If
- End If
- Else
- If input(i - 1) = "J" Then
- If i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("J")
- output = list.ToArray()
- Else
- If Not i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("j")
- output = list.ToArray()
- End If
- End If
- End If
- End If
- If input(i - 1) = "k" Then
- If i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("K")
- output = list.ToArray()
- Else
- If Not i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("k")
- output = list.ToArray()
- End If
- End If
- Else
- If input(i - 1) = "K" Then
- If i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("K")
- output = list.ToArray()
- Else
- If Not i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("k")
- output = list.ToArray()
- End If
- End If
- End If
- End If
- If input(i - 1) = "l" Then
- If i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("L")
- output = list.ToArray()
- Else
- If Not i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("l")
- output = list.ToArray()
- End If
- End If
- Else
- If input(i - 1) = "L" Then
- If i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("L")
- output = list.ToArray()
- Else
- If Not i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("l")
- output = list.ToArray()
- End If
- End If
- End If
- End If
- If input(i - 1) = "m" Then
- If i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("M")
- output = list.ToArray()
- Else
- If Not i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("m")
- output = list.ToArray()
- End If
- End If
- Else
- If input(i - 1) = "M" Then
- If i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("M")
- output = list.ToArray()
- Else
- If Not i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("m")
- output = list.ToArray()
- End If
- End If
- End If
- End If
- If input(i - 1) = "n" Then
- If i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("N")
- output = list.ToArray()
- Else
- If Not i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("n")
- output = list.ToArray()
- End If
- End If
- Else
- If input(i - 1) = "N" Then
- If i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("N")
- output = list.ToArray()
- Else
- If Not i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("n")
- output = list.ToArray()
- End If
- End If
- End If
- End If
- If input(i - 1) = "o" Then
- If i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("O")
- output = list.ToArray()
- Else
- If Not i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("o")
- output = list.ToArray()
- End If
- End If
- Else
- If input(i - 1) = "O" Then
- If i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("O")
- output = list.ToArray()
- Else
- If Not i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("o")
- output = list.ToArray()
- End If
- End If
- End If
- End If
- If input(i - 1) = "p" Then
- If i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("P")
- output = list.ToArray()
- Else
- If Not i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("p")
- output = list.ToArray()
- End If
- End If
- Else
- If input(i - 1) = "P" Then
- If i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("P")
- output = list.ToArray()
- Else
- If Not i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("p")
- output = list.ToArray()
- End If
- End If
- End If
- End If
- If input(i - 1) = "q" Then
- If i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("Q")
- output = list.ToArray()
- Else
- If Not i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("q")
- output = list.ToArray()
- End If
- End If
- Else
- If input(i - 1) = "Q" Then
- If i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("Q")
- output = list.ToArray()
- Else
- If Not i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("q")
- output = list.ToArray()
- End If
- End If
- End If
- End If
- If input(i - 1) = "r" Then
- If i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("R")
- output = list.ToArray()
- Else
- If Not i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("r")
- output = list.ToArray()
- End If
- End If
- Else
- If input(i - 1) = "R" Then
- If i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("R")
- output = list.ToArray()
- Else
- If Not i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("r")
- output = list.ToArray()
- End If
- End If
- End If
- End If
- If input(i - 1) = "s" Then
- If i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("S")
- output = list.ToArray()
- Else
- If Not i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("s")
- output = list.ToArray()
- End If
- End If
- Else
- If input(i - 1) = "S" Then
- If i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("S")
- output = list.ToArray()
- Else
- If Not i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("s")
- output = list.ToArray()
- End If
- End If
- End If
- End If
- If input(i - 1) = "t" Then
- If i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("T")
- output = list.ToArray()
- Else
- If Not i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("t")
- output = list.ToArray()
- End If
- End If
- Else
- If input(i - 1) = "T" Then
- If i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("T")
- output = list.ToArray()
- Else
- If Not i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("t")
- output = list.ToArray()
- End If
- End If
- End If
- End If
- If input(i - 1) = "u" Then
- If i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("U")
- output = list.ToArray()
- Else
- If Not i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("u")
- output = list.ToArray()
- End If
- End If
- Else
- If input(i - 1) = "U" Then
- If i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("U")
- output = list.ToArray()
- Else
- If Not i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("u")
- output = list.ToArray()
- End If
- End If
- End If
- End If
- If input(i - 1) = "v" Then
- If i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("V")
- output = list.ToArray()
- Else
- If Not i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("v")
- output = list.ToArray()
- End If
- End If
- Else
- If input(i - 1) = "V" Then
- If i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("V")
- output = list.ToArray()
- Else
- If Not i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("v")
- output = list.ToArray()
- End If
- End If
- End If
- End If
- If input(i - 1) = "w" Then
- If i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("W")
- output = list.ToArray()
- Else
- If Not i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("W")
- output = list.ToArray()
- End If
- End If
- Else
- If input(i - 1) = "W" Then
- If i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("W")
- output = list.ToArray()
- Else
- If Not i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("w")
- output = list.ToArray()
- End If
- End If
- End If
- End If
- If input(i - 1) = "x" Then
- If i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("X")
- output = list.ToArray()
- Else
- If Not i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("x")
- output = list.ToArray()
- End If
- End If
- Else
- If input(i - 1) = "X" Then
- If i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("X")
- output = list.ToArray()
- Else
- If Not i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("x")
- output = list.ToArray()
- End If
- End If
- End If
- End If
- If input(i - 1) = "y" Then
- If i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("Y")
- output = list.ToArray()
- Else
- If Not i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("y")
- output = list.ToArray()
- End If
- End If
- Else
- If input(i - 1) = "Y" Then
- If i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("Y")
- output = list.ToArray()
- Else
- If Not i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("y")
- output = list.ToArray()
- End If
- End If
- End If
- End If
- If input(i - 1) = "z" Then
- If i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("Z")
- output = list.ToArray()
- Else
- If Not i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("z")
- output = list.ToArray()
- End If
- End If
- Else
- If input(i - 1) = "Z" Then
- If i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("Z")
- output = list.ToArray()
- Else
- If Not i / 2 = Math.Round(i / 2) Then
- Dim list As New List(Of String)(output)
- list.Add("z")
- output = list.ToArray()
- End If
- End If
- End If
- End If
- Next i
- Dim finalOutput As String
- finalOutput = ""
- For Each item As String In output
- Dim newString As String
- newString = New System.Text.StringBuilder().Append(finalOutput).Append(item).ToString()
- finalOutput = newString
- Next
- Return finalOutput
- End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement