How do I make a typewriter effect with cursor and backspace?

Woops, I changed names of things so that they would be easier to read, but forgot to change one

dinBedrift.text=currText

Was supposed to be

textfield.text=currText