From 6cbb03d653aeb12f9d33b2ab75383f5b506cb912 Mon Sep 17 00:00:00 2001 From: bjculkin Date: Thu, 1 Mar 2018 19:12:12 -0500 Subject: Update --- .../java/bjc/utils/ioutils/format/CLFormatter.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'base/src/main/java/bjc/utils/ioutils') diff --git a/base/src/main/java/bjc/utils/ioutils/format/CLFormatter.java b/base/src/main/java/bjc/utils/ioutils/format/CLFormatter.java index 8172011..1ac97a6 100644 --- a/base/src/main/java/bjc/utils/ioutils/format/CLFormatter.java +++ b/base/src/main/java/bjc/utils/ioutils/format/CLFormatter.java @@ -111,6 +111,25 @@ public class CLFormatter { return sb.toString(); } + + /** + * Format a string in the style of CL's FORMAT. + * + * @param format + * The format string to use. + * @param params + * The parameters for the string. + * @return The formatted string. + */ + public String formatString(String format, Iterable params) { + StringBuffer sb = new StringBuffer(); + /* Put the parameters where we can easily handle them. */ + Tape tParams = new SingleTape<>(params); + + doFormatString(format, sb, tParams); + + return sb.toString(); + } /** * Fill in a partially started format string. -- cgit v1.2.3