Menu

[Solved]Given String Return Array Char Values Contains Characters String Reverse Order Example Str Q37290272

Given a String, return an array of char values that contains thecharacters of the string in reverse order. For example, if thestring is “Java”, the resulting array will contain the characters{‘a’, ‘v’, ‘a’, ‘J’}.

Examples:

reverseStringToArray(“Java”) -> {‘a’, ‘v’, ‘a’, ‘J’}reverseStringToArray(“This is a test.”) -> {‘.’, ‘t’, ‘s’, ‘e’, ‘t’, ‘ ‘, ‘a’, ‘ ‘, ‘s’, ‘i’, ‘ ‘, ‘s’, ‘i’, ‘h’, ‘T’}

*No printing, no scanners, just code that returns any possiblestring in reverse order as shown in the examples above*

*Do in Java language please*

public char[] reverseStringToArray(String str)
{
*ENTER CODE HERE*
}

Expert Answer


Answer to Given a String, return an array of char values that contains the characters of the string in reverse order. For example,… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *