Reverse a String

By Cooldudue | My Coding adventure | 6 May 2022


This was a pretty easy one. From the previous problem, I knew how to convert a string to an array of char. Then I had to make a copy of the array but in Java, it's not as easy as saying a=b. Then I looped through the first array replacing each letter with the corresponding letter of the second array. Boom easy peasy. Tomorrow I will create a method that can count how many duplicate words are in a string.

Check out my code on GitHub.

How do you rate this article?


1

0


My Coding adventure
My Coding adventure

Hello, I am a recent graduate from the University of Cape Town. I have a Bachelor of Science in Mathematics and Applied Mathematics. I am interested in becoming a developer. If you are interested in hiring please check out my CV and we can get in contact. I will be posting any projects I am working on here. My Java is a little rusty so I will be working on small problems to familiarise myself again. My CV: https://docs.google.com/document/d/1qVs7YYqWrkn70xxv6EdDgAH3k7LVA2unwC8tLzQCS4M/edit?usp=sharing

Send a $0.01 microtip in crypto to the author, and earn yourself as you read!

20% to author / 80% to me.
We pay the tips from our rewards pool.