printf ("hello %.*s\n", 5, "there is no good going on"); NSLog (@"hello %.*s\n", 5, "there is no good going on");results inhello there 2007-05-04 09:14:15.575 printf[4914] hello thereSimilarly, something like
printf ("hello %*.*s\n", 10, 5, "florgsnorgle");
will right-justify 'florg' in a field of 10 characters.(Thanks to TVL for this goodie)