SK9 SK9 - 1 year ago 121
Android Question

Enforcing spaces in string resources

In an Android string resource, how do I enforce a space?

For example, when I do " result" rather than "result" I still see "result" in my application's text view.

Answer Source

Did you try to surround your string with quotes? Maybe leading and trailing whitespaces are stripped automatically.

<string name="foo">" bar"</string>

See the example at in section "Escaping apostrophes and quotes".

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download