Reputation: 41
How do I combine values from each source as mentioned say for example I want to change the titlebar value...
page.setTitle(R.id.pagetitle)
Combine with...
page.setTitle("a text")
In order to output...
"R.id.pagetitle: a text" (note the " : ")
What is used in Java to connect these values like " . " in PHP or " + " in JavaScript?
Upvotes: 1
Views: 82
Reputation: 28823
Its very simple.
String titleText = firstText.concat("a text");
page.setTitle(titleText);
Hope it helps.
Upvotes: 1
Reputation: 662
You can use String.Format
String myString = String.Format("%s: a title", getText(R.id.pagetitle));
Upvotes: 2