Custom Post excerpt not working correctly

Why not use substr?

Function example that returns shortened excerpt:

function shortened_excerpt() {

    echo substr(get_the_excerpt(), 0, 30) . "...";

}