![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | Overloaded |
Hello! I’m curious as to how string.erase() works. I’m trying to remove characters from a string (let’s call it strName) from a specific location inside the string.
But when I do strName = strName.erase(2, 3), it returns an error saying “Assigned value type (null) doesn’t match the variable’s type (String)”. If I just do strName.erase(2, 3), it doesn’t seem to do anything. From what I’ve seen in the documentation, erase is the only void method in the string class. Any ideas as to why this is? Am I doing something wrong, or it should be returning a string and not void? Thanks! I’m using Godot Engine v3.1 stable.mono.official (GDScript)