Package it.unive.lisa.util
Class StringUtilities
- java.lang.Object
-
- it.unive.lisa.util.StringUtilities
-
public class StringUtilities extends java.lang.Object
Utility methods for building and manipulating strings.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
indent(java.lang.String target, java.lang.String indent, int amount)
Indents all lines oftarget
by usingindent
repeatedamount
times.static java.lang.String
ordinal(int i)
Yields the ordinal for the given integer by appending eitherst
,nd
,rd
, orth
to it.
-
-
-
Method Detail
-
ordinal
public static java.lang.String ordinal(int i)
Yields the ordinal for the given integer by appending eitherst
,nd
,rd
, orth
to it.- Parameters:
i
- the integer- Returns:
- the ordinal string
-
indent
public static java.lang.String indent(java.lang.String target, java.lang.String indent, int amount)
Indents all lines oftarget
by usingindent
repeatedamount
times.- Parameters:
target
- the string to indentindent
- the string to use as indentationamount
- the number of timesindent
should be repeated- Returns:
- the indented string
-
-