Javatpoint Logo

getsumofnumbers

By: naveen*** On: Wed Jun 28 17:53:10 IST 2017     Question Reputation0 Answer Reputation0 Quiz Belt Series Points0  0Blank User
write method public static int getSumOfNumbers(String s)
Please implement this method to
return the sum of all integers found in the parameter String. You can assume that
integers are separated from other parts with one or more spaces (' ' symbol).
For example, s="12 some text 3 7", result: 22 (12+3+7=22)
Up0Down