I know how to add onto strings, it would be this for example: String.Value = "Hi"..Player.Name.."!" But how do I remove parts of a string an exmple would be I have something named "Player's_House" and I want to remove "'s_House" off of it?
This is easily accomplished with patterns! The function you need is string.gsub
. This function takes in a string to replace in, a pattern, a replacement string, and optionally a limit of the number of substitutions. Patterns, which are similar in function to Regex (though far more lightweight), are a way to search for various substrings based on specified information. In this case, however, you just want to search for a specific string, "'s_House", and remove it. Thus, your code would be as follows:
string.gsub("Player's_House", "'s_House", "")
Further reading on patterns: http://www.lua.org/pil/20.2.html Further reading on the string library: http://lua-users.org/wiki/StringLibraryTutorial