How to define format in Java String.format(format,args..) where args are dynamic -


when args dynamic how define format,where args 1 can define format “sss %d”?

official javadoc (https://docs.oracle.com/javase/7/docs/api/java/util/formatter.html) states 3 kinds of formatting types:

  • general, character , number : %[argument_index$][flags][width][.precision]conversion
  • dates: %[argument_index$][flags][width]conversion
  • others: %[flags][width]conversion

none of them allows use conditions represent in case of non matching args ....

i think parse both parameters: string format , object[] arguments, create coherent pair of parameters depending on runtime circumstances.


Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -