format statement in a string resource file

Save

There are the many scenarios where we format a statement at the run time, means we attached a string, decimal, floating point number into a string of resource file.

If we need to format our strings, then we can do so by putting our format arguments in the string resource, as demonstrated by the following example resource.

In this example, the format string has two arguments: %1$s is a string and is a%2$d decimal number.

We format string by calling-

Or, We also format a string resource as-

We format string it –

References:- https://developer.android.com/guide/topics/resources/string-resource.html#FormattingAndStyling

. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


Be the first to comment.

css.php

Excellent work, fast, good quality and understood the brief perfectly! Quick responses developing the project and very good cooperation. I suggest to anyone.

Stathis Plakidas

Stathis Plakidas

Talk to Sales

Global

Live Chat
Start a Project


    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home