Originally Posted by ChaosInc
Worked like a charm. Now mind explaining it to me? LOL
|
Info on gsub
The second argument ("([a-z]+)([A-Z][a-z]+)") looks for a lower case letter ([a-z]) followed by an uppercase letter ([A-Z]) followed by a lower case letter ([a-z]). So in the case of ThunderBluff, it would find "rBl" as the pattern. Something like LookingForGroup would find "gFo" and "rGr". It then substitutes it with the third argument ("%1 %2"). In this case, it is substituting the first letter (%1) and the second letter (%2), combined would be (%1%2) with (%1 %2); essentially adding a space inbetween them. So "rBl" becomes "r Bl" in the string, making "ThunderBluff" change to "Thunder Bluff"
I hope that's easier to understand than it is to explain =/