NAVEX Interview Question

Reverse the words in a string. Ex. "Hello World" becomes "World Hello"

Interview Answer

Anonymous

Aug 20, 2018

arr = String.split("\\s+"); for (int i = arr.length()-1; i >= 0; i--){ print(arr[i]); }