I am trying to make an application that will reverse a string using a while loop. Just wondering if I am on the right path or not.
So I thought I would make a while loop to determine how many chars
i should make. Then I would just print them in reverse in the console.
Here is my code so far. Any help would be appreciated.
// Get the text from the input from the user
// Outputs it to the Text area
// Uses while loop to calculate how many chars to create
String Startword = txfInput.getText();
int LengthOfWord = Startword.length();
int Counter = 1;
while (Counter <= LengthOfWord)
{
// Creates amounts of chars based off the counter
Counter = Counter +1 ;
}
Any suggestions?