by TazeTSchnitzel · 4y ago · 0 comments
NSString *foo = [@"foo" stringByAppendingString:@"bar"];
It's not that bad. "foo" + "bar"The Add operation has a whole bunch of properties and this not only isn't most of them, it's arguably not any of them, the main argument for + as a string concatenate operator is "Well, people seem to like it". Which, I guess I/O streams doesn't even have that going for it, but it's a pretty terrible rationale.
Look, just grow string interpolate and write f"{foo}{bar}" or whatever as much as you like don't abuse unrelated operators.
const char *s = "foo" "bar"; id foo = [@"foo" cat:@"bar"];
I have a category method added to NSString: - (id)cat:(id)arg { return [self stringByAppendingString:arg]; }