Limit word count in word press content

there is a predefined function to set word limit in wordpress

<?php
$wordCount = 50;
echo wp_trim_words(get_the_content(),$wordCount,'....');
?>