| about | help | code help+videos | done | prefs |
Given a String return an integer value. Ignore characters that are not digits unless there is a negative sign before the first digit in which case the integer value should be negative. The first non-digit character found after a number starts ends the number so "abc123abc", "123", "123abc", and "abc123.5" are all the integer value 123. If no number is found return 0.strToInt("abc123abc") → 123 strToInt("123") → 123 strToInt("123abc") → 123 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 300
Copyright Nick Parlante 2017 - privacy