diff options
author | Arne Juul <arnej@verizonmedia.com> | 2021-06-29 09:02:05 +0000 |
---|---|---|
committer | Arne Juul <arnej@verizonmedia.com> | 2021-06-29 09:52:33 +0000 |
commit | 73aa0d1882f0b2ec62e55e42dafc8a4765a31b1b (patch) | |
tree | e9f1974e7889f8ad489a8efc7dfbb9991cde34ea /vespajlib/src/main/java/com/yahoo | |
parent | e8713a281bd8619f89b276bfca1a339b48a64e6e (diff) |
add convenience function wrapping "String.format(Locale.US, ...)"
Diffstat (limited to 'vespajlib/src/main/java/com/yahoo')
-rw-r--r-- | vespajlib/src/main/java/com/yahoo/text/Text.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/vespajlib/src/main/java/com/yahoo/text/Text.java b/vespajlib/src/main/java/com/yahoo/text/Text.java index 85b28639d89..4b1ee57b47d 100644 --- a/vespajlib/src/main/java/com/yahoo/text/Text.java +++ b/vespajlib/src/main/java/com/yahoo/text/Text.java @@ -1,6 +1,7 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.text; +import java.util.Locale; import java.util.OptionalInt; /** @@ -186,4 +187,7 @@ public final class Text { return s.substring(0, length - 4) + " ..."; } + public static String fmt(String format, Object... args) { + return String.format(Locale.US, format, args); + } } |