original_string: public static function truncate($str, $maxlength=20)
      {
  
          if(strlen($str) > $maxlength){
              $str = substr($str, 0, $maxlength-3).'...';
          }
  
          return $str;
      }
code: public static function truncate($str, $maxlength=20)
      {
  
          if(strlen($str) > $maxlength){
              $str = substr($str, 0, $maxlength-3).'...';
          }
  
          return $str;
      }
code_tokens: public static function truncate ( $ str , $ maxlength = 20 ) { if ( strlen ( $ str ) > $ maxlength ) { $ str = substr ( $ str , 0 , $ maxlength - 3 ) . '...' ; } return $ str ; }
docstring: Truncates a string to a certain length and right padswith ...
  
  @param string $str
  @param integer $maxlength The maximum length, keep in mind that the ... counts as three chars
  @return string
docstring_tokens: Truncates a string to a certain length and right padswith ...