Return a String as an Integer

Published by 11level360 in

Create a function that takes a string and returns it as an integer.

Examples

string_int("6") ➞ 6

string_int("1000") ➞ 1000

string_int("12") ➞ 12

Notes

  • All numbers will be whole.
  • All numbers will be positive.
Watch a quick demo on how Edabit works.