Adding whitespace in Java

I think you are talking about padding strings with spaces. One way to do this is with string format codes. For example, if you want to pad a string to a certain length with spaces, use something like this: String padded = String.format(“%-20s”, str); In a formatter, % introduces a format sequence. The – means … Read more

How to set 4 space tab in bash

That’s not a property of your shell (or php or cat). It’s your terminal that manages the output. Use the tabs command to change the behavior: $ tabs 4 $ echo -e “a\tb” a b $ tabs 12 $ echo -e “a\tb” a b (tabs is specified in POSIX, and output above is “faked”: it’s … Read more

Right aligned UITextField spacebar does not advance cursor in iOS 7

It would be a bit of a hack, but if you really need that to look the iOS6 way, you can replace space with non-breaking space as it’s written. It’s treated differently. Example code could look like this: – (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string { // only when adding on the end of textfield && … Read more