Problem 57. Summing Digits within Text

Given a string with text and digits, add all the numbers together.

Examples:

 Input str = '4 and 20 blackbirds baked in a pie'
 Output total is 24
 Input str = '2 4 6 8 who do we appreciate?'
 Output total is 20

Solution Stats

55.72% Correct | 44.28% Incorrect
Last Solution submitted on Mar 18, 2024

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers2374

Suggested Problems

More from this Author96

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!