Answer to Question #15351 in Visual Basic for drei

Question #15351
Hello.. I'm working on a reversing program in vb.net
The first thing that we have to do is to reverse the input without using the reverse method and this is how i did it.

Dim input As String = txtInput.Text
Dim output As String = ""
Dim CharStr As New Char

For Each CharStr In input
output = CharStr & output
Next
txtOutput.Text = output

now i need to make the reversed input in alternate casing.
ex: the input is computer and the output will be ReTuPmOc
i can only make the proper case, pls help :(
1
Expert's answer
2012-09-27T11:29:35-0400
Module Module1

Sub Main()
Dim input As String = "Retupmoc"
Dim output As String = ""

Dim txtOutput As String = ""


For i As Integer = input.Length - 1 To 0 Step -1
output += input(i)
Next

For i As Integer = 0 To input.Length - 1
If (i Mod 2 = 1) Then
txtOutput += input(i).ToString().ToLower()
Else
txtOutput += input(i).ToString().ToUpper()
End If

Next
Console.WriteLine(output)
Console.WriteLine(txtOutput)
Console.ReadLine()
End Sub

End Module

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

Assignment Expert
01.10.12, 16:50

You're welcome. We are glad to be helpful. If you really liked our service please press like-button beside answer field. Thank you!

drei
01.10.12, 16:34

Hey, I forgot to thank you for this one.. well, thank you guys :) i appreciate the help a lot, have a great day!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS