base case is string.length()<=1 , but string length is not decrease in any line in this code, stackoverflow will occur