diff options
| author | bjculkin <bjculkin@mix.wvu.edu> | 2018-03-01 19:12:12 -0500 |
|---|---|---|
| committer | bjculkin <bjculkin@mix.wvu.edu> | 2018-03-01 19:12:12 -0500 |
| commit | 6cbb03d653aeb12f9d33b2ab75383f5b506cb912 (patch) | |
| tree | 68cdbb5b45e52ea7ce1f20d3c5a777fb1cbb8101 /base/src/main/java/bjc/utils/ioutils | |
| parent | 10beb8e502ec8cbb02162a09da2d826ea2a1b1fc (diff) | |
Update
Diffstat (limited to 'base/src/main/java/bjc/utils/ioutils')
| -rw-r--r-- | base/src/main/java/bjc/utils/ioutils/format/CLFormatter.java | 19 |
1 files changed, 19 insertions, 0 deletions
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<Object> params) { + StringBuffer sb = new StringBuffer(); + /* Put the parameters where we can easily handle them. */ + Tape<Object> tParams = new SingleTape<>(params); + + doFormatString(format, sb, tParams); + + return sb.toString(); + } /** * Fill in a partially started format string. |
