Shorter NSStringWithFormat #73
Comments
+1, love it. |
👍 |
How about That'd give it a perfect hint, altho the choice is on you. Love the idea. |
@supermarin Agreed. Great! I'll create a pull-request soon. |
I think it should be If you wanted to shorten it, I'd be OK with |
Hm, that makes sense; altho it could get verbose-y again. [@"Hello %@" format:@"world"];
[@"Hello %@" withFormat:@"world"];
[@"Hello %@" withArgs:@"world"];
[@"Hello %@" formatWithArgs:@"world"];
[NSString stringWithFormat:@"Hello %@", @"world"];
NSStringWithFormat(@"Hello", @"world"); @iluuu1994 it's also worth pointing out that the main goal of |
Agreed. See this comparison: [@"Hello %@" formatWithArgs:@"world"];
NSStringWithFormat(@"Hello %@", @"world"); I think the latter is much clearer to read. |
@neilco Good point. I like |
Well if that's the case my idea isn't worth a lot. |
fair enough, thanks @iluuu1994! |
As you all know,
[NSString stringWithFormat:@"...", ...]
is a lot of syntax for something so common. This is why ObjectiveSugar implemented theNSStringWithFormat
function.It is indeed shorter, but well... not a lot.
How about a
format:
method onNSString
?[@"..." format:...]
would be much more appealing in my opinion.I will implement this method and update the tests and doc if anyone finds this useful.
The text was updated successfully, but these errors were encountered: