Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Visual Basic (https://www.askmehelpdesk.com/forumdisplay.php?f=469)
-   -   Reverse a String in Visual Basic (https://www.askmehelpdesk.com/showthread.php?t=650537)

  • Apr 12, 2012, 05:18 PM
    lamlamlamiaaa
    Reverse a String in Visual Basic
    I want to make a program where the user enters a word and it will come out backwards.
    For Example:
    Basic -> cisaB

    Please and Thank you!
  • Apr 12, 2012, 05:22 PM
    ScottGem
    Use a For... Next loop to loop for the length of the string. With each pass of the loop Use the Right() function to grab the last character and add it to a new string. Then use the Left() function to replace the string with the remaining characters.
  • Apr 13, 2012, 06:29 AM
    lamlamlamiaaa
    Can you explain a bit more how to use the Right() and Left() function?
  • Apr 13, 2012, 08:08 AM
    ScottGem
    I'm assuming this is a homework question. That's why I didn't show you a code sample. I just gave you enough direction to find the answer. There are plenty of VB resources that explain how to use the Right and Left functions and Loops that you can look up.

  • All times are GMT -7. The time now is 07:37 PM.