View Single Post
04-12-11, 12:40 PM   #10
Xinhuan
A Chromatic Dragonspawn
 
Xinhuan's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 174
I'm not sure why your code is so complicated.

Code:
arg1 = string.gsub(arg1, "%s+", " ")    -- Replaces consecutive spaces with one space
part1, part2 = string.split(" ", arg1)  -- splits arg1 by the delimiter " " character
part1 = string.lower(part1)
part2 = string.lower(part2)
Note that string.split() returns as many results as there are strings delimited by the delimiter.
__________________
Author of Postal, Omen3, GemHelper, BankItems, WoWEquip, GatherMate, GatherMate2, Routes and Cartographer_Routes
  Reply With Quote