Is there a way to format a String in Flex

前端 未结 3 1627
庸人自扰
庸人自扰 2021-02-14 03:05

Is it possible to do something like this:

var s:String = format(\"%20d %-10s %s\", time, type, message);

In languages like C, C++, C#, Python,

3条回答
  •  心在旅途
    2021-02-14 03:30

    You probably are looking for mx.utils.StringUtil.substitute(). Works similar to .NET String.Format().

    For Example:

    StringUtil.substitute("Hello {0}", ["World"]);
    

    Adobe Livedocs for StringUtil class

提交回复
热议问题