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  
whitespace.
use  
non-breakable whitespace.
use  
regular space.
Comments
Post a Comment