when I learned the book named android编程权威指南 I encountered a problem.It is print out a format string.So I find some answer.
If I want to show a string dynamically,I can use %1$s etc.
Here are the formats.
%n$ms: n represent the n th variate,m represent leave m spaces,s represent the variate is string.
%n$md: n represent the n th variate,m represent leave m spaces,s represent the variate is integer.
%n$mf: n represent the n th variate,m represent leave m spaces,s represent the variate is float.
It can also be expressed by %d %f %s
String string=getResources().getString(R,string.---);
String formated=string.format(string, Object... args);
String formated=getString(R,string.---,Object... args);
when I learned the book named android编程权威指南 I encountered a problem.It is print out a format string.So I find some answer.
If I want to show a string dynamically,I can use %1$s etc.
Here are the formats.
String string=getResources().getString(R,string.---);
String formated=string.format(string, Object... args);
String formated=getString(R,string.---,Object... args);