Thread: Reverse string
View Single Post
12-25-21, 03:44 PM   #2
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,313
Specific to the WoW API, string.format() lets you specify which args go where by modifying the format specifier. By default, they are left-to-right in order. This would flip the order by specifying the second argument goes in the first slot and vice versa. Blizzard did this specifically to support localization.
Code:
FACTION_STANDING_INCREASED = "%2$d %1$s"
Note: The letters define the data type, changing these to be different than what the arguments are can cause type mismatch errors.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 12-25-21 at 03:48 PM.
  Reply With Quote