I have been messing around with recursion today. Often a programming technique that is not used enough.
I set out to recursively reverse a string. Here\'s what I cam
This is what I've found to work and use recursive. You can pass str.length() as strLength argument
str.length()
private static String reverse(String str, int strLength) { String result = ""; if(strLength > 0) result = str.charAt(strLength - 1) + reverse(str, strLength - 1); return result; }