String Incrementer Java Coding Challenge | Edabit | How'd You Code That?

Published: 07 June 2020
on channel: Ed Clark
512
10

String Incremented

In today’s challenge, you’re tasked with writing a method that increments a string to create a new string.
The rules of the challenge are:
If the string ends with a number, the number should be incremented by 1.
incrementString("foo099") ➞ "foo100"
If the string doesn't end with a number, 1 should be added to the new string.
incrementString("foo") ➞ "foo1"
If the number has leading zeros, the amount of digits should be considered.
incrementString("foobar0009") ➞ "foobar0010"

Closed Captions/Subtitles - [email protected]

Video Editing - [email protected]

Song: Sunflower - Ikson (Vlog No Copyright Music)
Music promoted by Vlog No Copyright Music.
  / ikson  


Watch video String Incrementer Java Coding Challenge | Edabit | How'd You Code That? online without registration, duration hours minute second in high quality. This video was added by user Ed Clark 07 June 2020, don't forget to share it with your friends and acquaintances, it has been viewed on our site 512 once and liked it 10 people.