Your Courses All Courses
Isolate a Number from a String and Multiply it by 2

Isolate a Number from a String and Multiply it by 2

No code, like working with code, can require a user to convert a particular variable across data types in order to perform a desired operation.

rate limit

Code not recognized.

About this course

No code, like working with code, can require a user to convert a particular variable across data types in order to perform a desired operation. There are plenty of challenges here that cover basic instances of typecasting. But what happens if you need to isolate a just a small section of a string? What if you need to perform some kind of arithmetic or other operation on top of that isolated value? That’s what we’ll cover in this challenge. 


For this challenge, given the record ID format xxxx-01, write logic to multiply the number on the end by 2.

Curriculum3 min

  • Challenge Overview 1 min
  • Answer Key 2 min

About this course

No code, like working with code, can require a user to convert a particular variable across data types in order to perform a desired operation. There are plenty of challenges here that cover basic instances of typecasting. But what happens if you need to isolate a just a small section of a string? What if you need to perform some kind of arithmetic or other operation on top of that isolated value? That’s what we’ll cover in this challenge. 


For this challenge, given the record ID format xxxx-01, write logic to multiply the number on the end by 2.

Curriculum3 min

  • Challenge Overview 1 min
  • Answer Key 2 min