Maybe this should be:
Field->str.substr(0, Field->str.length() - 2);
?
Let's get first that function working well!
Ok, it's working, but on the first delete after each time new char was entered, as I said, it would delete the first two chars.
How do I fix the first delete? There must be a reason for this, and if we can find it we would be able to find reasonable solution.
EDIT:
Could it be a null character problem?
When I add sf::Text::Unicode to the string, does it include null character in the end of the string?
And does the null character counted by the str.length() ?
Perhaps this is the source of the problem?
Is there a way to make sure the string is NULL terminated?