original_string: protected function trim_center($string, $length) {
          $trimlength = ceil($length/2);
          $start = core_text::substr($string, 0, $trimlength);
          $end = core_text::substr($string, core_text::strlen($string)-$trimlength);
          $string = $start.'...'.$end;
          return $string;
      }
code: protected function trim_center($string, $length) {
          $trimlength = ceil($length/2);
          $start = core_text::substr($string, 0, $trimlength);
          $end = core_text::substr($string, core_text::strlen($string)-$trimlength);
          $string = $start.'...'.$end;
          return $string;
      }
code_tokens: protected function trim_center ( $ string , $ length ) { $ trimlength = ceil ( $ length / 2 ) ; $ start = core_text :: substr ( $ string , 0 , $ trimlength ) ; $ end = core_text :: substr ( $ string , core_text :: strlen ( $ string ) - $ trimlength ) ; $ string = $ start . '...' . $ end ; return $ string ; }
docstring: Truncate a string in the center
  @param string $string The string to truncate
  @param int $length The length to truncate to
  @return string The truncated string
docstring_tokens: Truncate a string in the center