Lextree Simply the best software for managing legal entities and documents.
The Berkman Letter Practical analysis and commentary for business, law, and more.

How do I reverse a String and at the same time delete one letter (until all what's left is a single letter) using loops? (JAVA)

0
stars
0
answers
23
views
Hello! I'm kinda new to (Java) programming so here's my problem. How can I reverse a String and then at the same time make the last letter deleted using a loop until all what's left is a single letter.

For example: 

User inputs "programming" 

The code should loop the input deleting one letter at a time (while reversed)

What should be the output is something like this:

gnimmargorp
gnimmargor
gnimmargo
gnimmarg
gnimmar
gnimma
gnimm
gnim
gni
gn
g

How can I make it done like that? Please help thanks alot!