id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

srp4379@lausd.net apquiz-string-2 > combineDigits
prev  |  next  |  chance

Given a String, find any digits in the String and combine them to make a single number, in the order that they are encountered from left to right. If there are no digits in the String, just return zero.


combineDigits("abc1def2ghi3jklm") → 123
combineDigits("hello45goodbye78") → 4578
combineDigits("1green0blue53red8purple") → 10538

...Save, Compile, Run (ctrl-enter)

public int combineDigits(String str) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 3

Copyright Nick Parlante 2017 - privacy