| Package | flare.util |
| Class | public class Strings |
format method provides a powerful mechanism for formatting
and templating strings.
| Property | Defined by | ||
|---|---|---|---|
| AD : String = "AD" [static] String indicating "AD" time.
| Strings | ||
| AM1 : String = "A" [static] Abbreviated string indicating "AM" time.
| Strings | ||
| AM2 : String = "AM" [static] Full string indicating "AM" time.
| Strings | ||
| BC : String = "BC" [static] String indicating "BC" time.
| Strings | ||
| DAY_ABBREVS : Array [static] Array of abbreviated names for days of the week.
| Strings | ||
| DAY_NAMES : Array [static] Array of full names for days of the week.
| Strings | ||
| DECIMAL_SEPARATOR : String = "." [static] Separator for decimal (fractional) values.
| Strings | ||
| MONTH_ABBREVS : Array [static] Array of abbreviated names for months of the year.
| Strings | ||
| MONTH_NAMES : Array [static] Array of full names for months of the year.
| Strings | ||
| NaN : String = "NaN" [static] String representing Not-a-Number (NaN).
| Strings | ||
| NEGATIVE_INFINITY : String = "-Inf" [static] String representing negative infinity.
| Strings | ||
| PM1 : String = "P" [static] Abbreviated string indicating "PM" time.
| Strings | ||
| PM2 : String = "PM" [static] Full string indicating "PM" time.
| Strings | ||
| POSITIVE_INFINITY : String = "+Inf" [static] String representing positive infinity.
| Strings | ||
| THOUSAND_SEPARATOR : String = "," [static] Separator for thousands values.
| Strings | ||
| Method | Defined by | ||
|---|---|---|---|
|
Strings()
Constructor, throws an error if called, as this is an abstract class.
| Strings | ||
|
align(s:String, align:int):String
[static]
Aligns a string by inserting padding space characters as needed.
| Strings | ||
|
format(fmt:String, ... args):String
[static]
Outputs a formatted string using a set of input arguments and string
formatting directives.
| Strings | ||
|
pad(x:Number, digits:int):String
[static]
Pads a number with a specified number of "0" digits on
the left-hand-side of the number.
| Strings | ||
|
padString(s:String, n:int):String
[static]
Pads a string with zeroes up to given length.
| Strings | ||
|
repeat(s:String, reps:int):String
[static]
Creates a new string by repeating an input string.
| Strings | ||
| Constant | Defined by | ||
|---|---|---|---|
| DEFAULT_NUMBER : String = "0.########" [static] Default formatting string for numbers.
| Strings | ||
| AD | property |
public static var AD:String = "AD"String indicating "AD" time.
| AM1 | property |
public static var AM1:String = "A"Abbreviated string indicating "AM" time.
| AM2 | property |
public static var AM2:String = "AM"Full string indicating "AM" time.
| BC | property |
public static var BC:String = "BC"String indicating "BC" time.
| DAY_ABBREVS | property |
public static var DAY_ABBREVS:ArrayArray of abbreviated names for days of the week.
| DAY_NAMES | property |
public static var DAY_NAMES:ArrayArray of full names for days of the week.
| DECIMAL_SEPARATOR | property |
public static var DECIMAL_SEPARATOR:String = "."Separator for decimal (fractional) values.
| MONTH_ABBREVS | property |
public static var MONTH_ABBREVS:ArrayArray of abbreviated names for months of the year.
| MONTH_NAMES | property |
public static var MONTH_NAMES:ArrayArray of full names for months of the year.
| NaN | property |
public static var NaN:String = "NaN"String representing Not-a-Number (NaN).
| NEGATIVE_INFINITY | property |
public static var NEGATIVE_INFINITY:String = "-Inf"String representing negative infinity.
| PM1 | property |
public static var PM1:String = "P"Abbreviated string indicating "PM" time.
| PM2 | property |
public static var PM2:String = "PM"Full string indicating "PM" time.
| POSITIVE_INFINITY | property |
public static var POSITIVE_INFINITY:String = "+Inf"String representing positive infinity.
| THOUSAND_SEPARATOR | property |
public static var THOUSAND_SEPARATOR:String = ","Separator for thousands values.
| Strings | () | constructor |
public function Strings()Constructor, throws an error if called, as this is an abstract class.
| align | () | method |
public static function align(s:String, align:int):StringAligns a string by inserting padding space characters as needed.
Parameterss:String — the string to align
|
|
align:int — an integer indicating both the desired length of
the string (the absolute value of the input) and the alignment
style (negative for left alignment, positive for right alignment)
|
String — the aligned string, padded or truncated as necessary
|
| format | () | method |
public static function format(fmt:String, ... args):StringOutputs a formatted string using a set of input arguments and string formatting directives. This method uses the String formatting conventions of the .NET framework, providing a very flexible system for mapping input values into various string representations. For examples and reference documentation for string formatting options, see this example page or Microsoft's documentation.
Parametersfmt:String — a formatting string. Format strings include markup
indicating where input arguments should be placed in the string,
along with optional formatting directives. For example,
{1}, {0} writes out the second value argument, a
comma, and then the first value argument.
|
|
... args — value arguments to be placed within the formatting
string.
|
String — the formatted string.
|
| pad | () | method |
public static function pad(x:Number, digits:int):StringPads a number with a specified number of "0" digits on the left-hand-side of the number.
Parametersx:Number — an input number
|
|
digits:int — the number of "0" digits to pad by
|
String — a padded string representation of the input number
|
| padString | () | method |
public static function padString(s:String, n:int):StringPads a string with zeroes up to given length.
Parameterss:String — the string to pad
|
|
n:int — the target length of the padded string
|
String — the padded string. If the input string is already equal or
longer than n characters it is returned unaltered. Otherwise, it
is left-padded with zeroes up to form an n-character string.
|
| repeat | () | method |
public static function repeat(s:String, reps:int):StringCreates a new string by repeating an input string.
Parameterss:String — the string to repeat
|
|
reps:int — the number of times to repeat the string
|
String — a new String containing the repeated input
|
| DEFAULT_NUMBER | constant |
public static const DEFAULT_NUMBER:String = "0.########"Default formatting string for numbers.