src/Text.php
public function toKebabCase() {
		if ($this->contains('_')) {
			return $this->replace('_', '-');
		}

		return new Text(mb_strtolower(preg_replace('/([a-z0-9])([A-Z])/', '$1-$2', $this->string)), $this->encoding);
	}
public function toKebabCase() {
		if ($this->contains('_')) {
			return $this->replace('_', '-');
		}

		return new Text(mb_strtolower(preg_replace('/([a-z0-9])([A-Z])/', '$1-$2', $this->string)), $this->encoding);
	}
public function toKebabCase ( ) { if ( $ this -> contains ( '_' ) ) { return $ this -> replace ( '_' , '-' ) ; } return new Text ( mb_strtolower ( preg_replace ( '/([a-z0-9])([A-Z])/' , '$1-$2' , $ this -> string ) ) , $ this -> encoding ) ; }
Convert this string into kebab-case. Numbers are considered as part of its previous piece.

<code>
$var = new Text('myOwnVariable');<br>
$var->toKebapCase(); // my-own-variable

$var = new Text('myTest3Variable');<br>
$var->toKebapCase(); // my-test3-variable
</code>

@return Text
Convert this string into kebab - case . Numbers are considered as part of its previous piece .