src/Recursion/recursion3.java
public static int printSum(String str, int sum, int i) {
		if (i == str.length())
			return sum;

		if (Character.isDigit(str.charAt(i))) {
			sum = sum + Integer.parseInt(String.valueOf(str.charAt(i)));
		}

		return printSum(str, sum, i + 1);
	}
//	print the sum of numbers in a string
print the sum of numbers in a string
print the sum of numbers in a string
public static int printSum(String str, int sum, int i) {
		if (i == str.length())
			return sum;
		if (Character.isDigit(str.charAt(i))) {
			sum = sum + Integer.parseInt(String.valueOf(str.charAt(i)));
		}
		return printSum(str, sum, i + 1);
	}
public static int printSum ( String str , int sum , int i ) { if ( i == str . length ( ) ) return sum ; if ( Character . isDigit ( str . charAt ( i ) ) ) { sum = sum + Integer . parseInt ( String . valueOf ( str . charAt ( i ) ) ) ; } return printSum ( str , sum , i + 1 ) ; }
print the sum of numbers in a string
print the sum of numbers in a string