Thread: String strip
View Single Post
01-30-15, 08:09 PM   #2
Choonstertwo
A Chromatic Dragonspawn
 
Choonstertwo's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2011
Posts: 194
You could use a slightly less restrictive pattern that matches everything after the first dash:
lua Code:
  1. ("PLAYERNAME-Aggra(Português)"):gsub("%-.+", "")

You could also use the WoW-specific strsplit function:
lua Code:
  1. (strsplit("-", "PLAYERNAME-Aggra(Português)", 2))

Note the extra set of parentheses to discard all return values except the first.
  Reply With Quote