Package org.flag4j.util
Class StringUtils
java.lang.Object
org.flag4j.util.StringUtils
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
Centers a string within a specified size bin.static String
Centers a string within a specified size bin.static String
ValueOfRound
(double value, int precision) Gets the string representation of a double rounded to the specified precision.static String
ValueOfRound
(CNumber value, int precision) Gets the string representation of acomplex number
rounded to the specified precision.
-
Constructor Details
-
StringUtils
private StringUtils()
-
-
Method Details
-
center
-
center
Centers a string within a specified size bin.- Parameters:
s
- String to center.size
- Size of the bin to center string within.pad
- Padding character.- Returns:
- A string made up of the padding character of specified size with the string s centered within it.
-
ValueOfRound
Gets the string representation of a double rounded to the specified precision.- Parameters:
value
- Value to convert to String.precision
- Precision to round value to.- Returns:
- The string representation of a double rounded to the specified precision.
-
ValueOfRound
Gets the string representation of acomplex number
rounded to the specified precision.- Parameters:
value
- Value to convert to String.precision
- Precision to round value to.- Returns:
- The string representation of a
complex number
rounded to the specified precision.
-