For goodness sake, it's not even NP-complete.

char *start = strchr(line, ' ') + 1; char *end = strrchr(line, ' ');
char *ret;
*end = '\0';
ret = strdup(start);
*end = ' ';
return ret;

Obviously there's no error checking, but there you go.  I don't see
what's inelegant about that.

This is C, use pointers, if you want high level string parsers, use
Perl.

Cheers,
Rob.
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[email protected]"

Reply via email to