e.g X company have Y employees
where X is a string variable and Y is an integer variable.
We can use this type of case in R.string also , as discussed below:
Write in strings.xml file
<string name="abc">%1$s company have %2$d employees.</string>
where $s stands for string
$d for integers
In java file
String mystring = getResources().getString(R.string.abc);
String finalstring = mystring.format(mystring, "Google",10000);
OUTPUT:
Google company have 10000 employees.
where X is a string variable and Y is an integer variable.
We can use this type of case in R.string also , as discussed below:
Write in strings.xml file
<string name="abc">%1$s company have %2$d employees.</string>
where $s stands for string
$d for integers
In java file
String mystring = getResources().getString(R.string.abc);
String finalstring = mystring.format(mystring, "Google",10000);
OUTPUT:
Google company have 10000 employees.