Can't append space at end of NSString
Posted
by Sam V
on Stack Overflow
See other posts from Stack Overflow
or by Sam V
Published on 2010-05-28T05:11:01Z
Indexed on
2010/05/28
5:21 UTC
Read the original article
Hit count: 273
I have a UITextView in which I want the initial value to be "@username " (notice the space after the username). This way the user can start typing right away without having to tap space. So I do:
textView.text = [NSString stringWithFormat:@"@%@ ", username];
But it seems like it's impossible to have an NSString ending with a space (it always gets stripped out). Am I correct? Is there any workaround for this?
© Stack Overflow or respective owner