Skip to content

Instantly share code, notes, and snippets.



Created Apr 27, 2010
What would you like to do?
AS3/Flex StringUtil.substitute
StringUtil.substitute("ClassName [name={0}, key={1}, field={2}, etc={3}]", name, key, field, etc);
StringUtil.substitute is a useful print formatter tucked away in the Flex SDK, if you're used to printf in C or String.format() in C# you'll be glad to find this
Whatever the case, rolling a complex string in AS3 is much easier with this than the alternative.
"ClassName [name=" + name + ", key=" + key + ", field=" + field + ", etc=" + etc + "]";
Which is pretty horrible, but I'm sure you've had to build 100's or 1000's of strings like this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment