String to Integer and Vice Versa

Published by Nomove in

Write two functions:

  1. toInt() : A function to convert a string to an integer.
  2. toStr() : A function to convert an integer to a string.

Examples

toInt("77") ➞ 77

toInt("532") ➞ 532

toStr(77) ➞ "77"

toStr(532) ➞ "532"

Notes

  • Don't forget to return the result.
  • If you get stuck on a challenge, find help in the Resources tab.
  • If you're really stuck, unlock solutions in the Solutions tab.
Watch a quick demo on how Edabit works.