Is there an ansi/posix way to print a string but with a maximum number of characters, say if I only wanted to print the first 10 chars of a 20 char string.

I have implemented my own function to do this, but I am just checking to see if there is a standard way?