Jump to content

How to remove a bunch of text?


OnlineCheater

Recommended Posts

Hey all,

I actually wonder how to remove a piece of text, I'm gonna give you examples:

For example I want to show a list of maps, those maps contain tags and i want to remove those tags only from the whole name.

I know it's a string.gsub or something, another string maybe, I don't remember and that's why I'm asking you.

Well, for exemple those mapnames:

"/ABC/ Mapname1"

"/DEF/ Mapname2"

"/OEHSHE/ Mapname3"

"/HSIUXOP/ Mapname4"

So here is my question, how to remove those tags between / /, should I create a table with all the tags and then do something like

  
tableName = {"/ABC/", "/DEF/", "/OEHSHE/", "/HSIUXOP/"} 
for i, v in pairs(tableName) do  
    if string.find(mapname, "v") then  
        mapname = mapname:string.gsub(v, "")  
    end  
end 
  

That's all I wanted to know, thanks in advance!

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...