WordPress at Your Fingertips
function is not described

wc_trim_string() WC 1.0

Trim a string and append a suffix.

No Hooks.

Return

String.

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 6.1.1

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;
}