0

HELLO There, I am in need of some help for my homework. I am doing the AP Computer Science Lab A10.1 StringUtil an In need of some help.

How do I do Number 2? Create a method that receives a string and returns a string that is the exact reversal of the characters in the first String?

my teacher is only asking for this one and the palindrome code which i have done

thank you!

2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by stultuske
0

HELLO There, I am in need of some help for my homework. I am doing the AP Computer Science Lab A10.1 StringUtil an In need of some help.

How do I do Number 2? Create a method that receives a string and returns a string that is the exact reversal of the characters in the first String?

my teacher is only asking for this one and the palindrome code which i have done

thank you!

well ... write a method in which you accept a String as a parameter, create a new, empty String, go through a loop that is as long as the number of characters in the original String
and say= newString = originalString's next character + newString
once the loop is finished, return the newString object

you might want to take a look at the substring method of String, can help you a lot.

since it's only one method you have to make, it should have been no problem for you to at least have tried to write some code. and no, we won't write every bit for you. you see, for us, this is not urgent at all

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.