aromal.s
10/26/2016, 10:57 AMval tobeFormatted:String = "Please enter a password with at least %s characters."
val stringParams = ArrayList<String>()
stringParams.add("3")
System.out.println(String.format(tobeFormatted,stringParams.toTypedArray()))
The output is
Please enter a password with at least [3] characters.
it is taking whole array as argument
* What i expect is like below *
Please enter a password with at least 3 characters.
however in java the below code for string format works flawlessly
String f = "Mi name is %s %s.";
System.out.println(String.format(f, new String[]{"John","Connor"}));