Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D339C10066 for ; Wed, 24 Jul 2013 18:39:52 +0000 (UTC) Received: (qmail 92491 invoked by uid 500); 24 Jul 2013 18:39:52 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 91969 invoked by uid 500); 24 Jul 2013 18:39:50 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 91828 invoked by uid 99); 24 Jul 2013 18:39:49 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Jul 2013 18:39:49 +0000 Date: Wed, 24 Jul 2013 18:39:49 +0000 (UTC) From: "Woonsan Ko (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (LANG-893) Default value for StrSubstitutor MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/LANG-893?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13718683#comment-13718683 ] Woonsan Ko commented on LANG-893: --------------------------------- ':-' seems to be a good option as default delimiter. Also seems simpler and focusing more on string substitution than others. And, of course it should be customizable like prefix/suffix of StrSubstitutor. Thanks for the suggestion! > Default value for StrSubstitutor > -------------------------------- > > Key: LANG-893 > URL: https://issues.apache.org/jira/browse/LANG-893 > Project: Commons Lang > Issue Type: Improvement > Components: lang.text.* > Affects Versions: 2.4 > Reporter: Lauri Siltanen > Priority: Minor > > public static void main(String[] args) { > String s = "The number of ${item} items currently available: ${number}"; > String result = StrSubstitutor.replace(s, Collections.singletonMap("item", "monitor")); > System.out.println(result); > } > This results in: "The number of monitor items currently available: ${number}". > I'd need a default value for a placeholder that cannot be resolved. > String result = StrSubstitutor.replace(s, Collections.singletonMap("item", "monitor"), "N/A"); > -> "The number of monitor items currently available: N/A". -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira