Multiple choice technology

What is the returned value for the following expression : decimal_strip(" -007 James")

  1. "-007"

  2. "007"

  3. " James"

  4. "-7"

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

decimal_strip extracts the first numeric value from a string. For ' -007 James', it extracts '-7' - it removes leading zeros after the negative sign, keeping only the essential numeric value. The function stops at the first non-numeric character after extracting the number.