public function test_limit_by_characters() { $this->assertEquals('WordPress...', Str::limit_by_characters('WordPress is web software you can use to create a beautiful website or blog.', 9)); $this->assertEquals('WordPress is...', wpdevsclub_limit_by_characters('WordPress is web software you can use to create a beautiful website or blog.', 13)); }
/** * Limit the number of characters in a string. * * @param string $value * @param int $limit * @param string $end * @return string */ function wpdevsclub_limit_by_characters($value, $limit = 100, $end = '...') { return Str::limit_by_characters($value, $limit, $end); }