WordPress at a glance
function is not described

wc_trim_string() WC 1.0

Trim a string and append a suffix.

No Hooks.

Return

String. Nothing.

Usage

wc_trim_string( $string, $chars, $suffix );
$string(string) (required)
String to trim.
$chars(int)
Amount of characters.
Default: 200
$suffix(string)
Suffix.
Default: '...'

Code of wc_trim_string() WC 5.3.0

<?php
function wc_trim_string( $string, $chars = 200, $suffix = '...' ) {
	if ( strlen( $string ) > $chars ) {
		if ( function_exists( 'mb_substr' ) ) {
			$string = mb_substr( $string, 0, ( $chars - mb_strlen( $suffix ) ) ) . $suffix;
		} else {
			$string = substr( $string, 0, ( $chars - strlen( $suffix ) ) ) . $suffix;
		}
	}
	return $string;
}