android - How to keep the spaces at the end and/or at the beginning of a String? -


i have concatenate these 2 strings resource/value files:

<string name="toast_memory_gamewon_part1">you found pairs ! on </string> <string name="toast_memory_gamewon_part2"> flips !</string> 

i way :

string message_all_pairs_found = getstring(r.string.toast_memory_gamewon_part1)+total_flips+getstring(r.string.toast_memory_gamewon_part2);  toast.maketext(this, message_all_pairs_found, 1000).show(); 

but spaces @ end of first string , @ beginning of second string have disappeared (when toast shown) ...

what should ?

i guess answer somewhere here : http://developer.android.com/reference/java/util/regex/package-descr.html#impnotes

or using & "&" caracter ??

even if use string formatting, still need white spaces @ beginning or end of string. these cases, neither escaping \, nor xml:space attribute helps. must use html entity &#160; whitespace.

use &#160; non-breakable whitespace.
use &#032; regular space.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -