We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
0 parents commit 32eee49Copy full SHA for 32eee49
FindSumOfNumbersApproachASCII.java
@@ -0,0 +1,17 @@
1
+package powerJavaLearning;
2
+
3
+public class FindSumOfNumbersApproachASCII {
4
5
+ public static void main(String[] args) {
6
+ String input ="asdf1qwer9as8d7";
7
+ char[] array = input.toCharArray();
8
+ int sum=0;
9
+ for (int i = 0; i < array.length; i++) {
10
+ if((int)array[i]>=48 && (int)array[i]<=57) {
11
+ sum+=Character.getNumericValue(array[i]);
12
+ }
13
+ System.out.println("integer " +Character.getNumericValue(array[i]));
14
15
+ System.out.println("Sum of Integers "+ sum);
16
17
+}
0 commit comments