android - How to keep the spaces at the end and/or at the beginning of a String? -
I need to include these two stars with my resources / value files:
& Lt; String name = "Toast_Memory_GameWon_part1" & gt; You got all the family! On & lt; / String & gt; & Lt; String name = "Toast_Memory_GameWon_part2" & gt; Flip! & Lt; / String & gt;
I do this like this:
string message_all_pairs_found = getString (R.string.Toast_Memory_GameWon_part1) + total_flips + getString (R.string.Toast_Memory_GameWon_part2 ); Toast. Make text (this, message_all_pace_found, 1000). Show ();
But at the end of the first string and the second string has disappeared in the beginning (when toast is shown) ...
What should I do ?
I think the answer is elsewhere:
Or it is like using something else; If you use string formatting for "and" sometimes you still need white space or end of your string. For these cases, the \
, nor the xml: space
attribute helps you get a white space for the HTML unit & amp; # 160;
should be used.
For non-obsolete white space & amp; # 160; Use
.
For the regular place, & amp; # 032; Use
.
Comments
Post a Comment