Package com.microej.stringformat
Class StringFormatExtension
- java.lang.Object
-
- com.microej.stringformat.StringFormatExtension
-
-
Constructor Summary
Constructors Constructor Description StringFormatExtension()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Stringformat(String format, Object... args)Returns a formatted string using the specified format string and arguments.
-
-
-
Method Detail
-
format
public static String format(String format, @Nullable Object... args)
Returns a formatted string using the specified format string and arguments.- Parameters:
format- A format stringargs- Arguments referenced by the format specifiers in the format string. If there are more arguments than format specifiers, the extra arguments are ignored. The number of arguments is variable and may be zero. The maximum number of arguments is limited by the maximum dimension of a Java array as defined by The Java™ Virtual Machine Specification. The behaviour on a null argument depends on the Formatter conversion.- Returns:
- A formatted string
- Throws:
IllegalFormatException- If a format string contains an illegal syntax, a format specifier that is incompatible with the given arguments, insufficient arguments given the format string, or other illegal conditions. For specification of all possible formatting errors, see the Details section of the formatter class specification.NullPointerException- If the format is null- See Also:
Formatter
-
-