replacing string with dynamic avalues java

Solutions on MaxInterview for replacing string with dynamic avalues java by the best coders in the world

showing results for - "replacing string with dynamic avalues java"
Olivier
20 Aug 2020
1String a = "{YY}-{MM}-{SEQNO}";
2a = a.replace("YY", "17").replace("MM", "06").replace("SEQNO", "0001");
3System.out.println(a);
4//Output:  {17}-{06}-{0001}
5
Valentina
29 Sep 2016
1System.out.printf("%S-%S-%S\n", ""+17, ""+06, ""+0001);
2
Floyd
13 May 2020
1String s = java.text.MessageFormat.format("I would like to have {0} KG of rice and {1} Litre of Milk. I only have ${2}, is this sufficient?",new String[]{"100","5","50"});
2System.out.println(s);
3
similar questions
queries leading to this page
replacing string with dynamic avalues java