strsplit()'s first argument must be 1 character long. If it is longer than 1 character, then ANY of the characters are treated as a delimiter. In your example
Code:
local realm, name = strsplit(" - ", UIDropDownMenu_GetText(CFM_LoadBox))
The delimeter you provided is basically " " or "-" (with " " repeated). So if you're splitting "Blackwing Lair - Chaosinc", then you end up getting the following returns:
Code:
"Blackwing", "Lair", "", "", "Chaosinc"
There are 2 empty strings there because there is nothing between " " and "-", and the second one is between "-" and " ".
If you are splitting "Barthilas - Xinhuan" then you basically get
Code:
"Barthilas", "", "", "Xinhuan"
Hence in your example code, your realm is correct, but your name is an empty string.
What you really want is this
Code:
local realm, name = string.match("Blackwing Lair - Chaosinc", "(.+) %- (.+)")