Class yii\helpers\StringHelper

Inheritanceyii\helpers\StringHelper » yii\helpers\BaseStringHelper
Available since version2.0
Source Code https://github.com/yiisoft/yii2/blob/master/framework/helpers/StringHelper.php

StringHelper

Public Methods

Hide inherited methods

MethodDescriptionDefined By
basename() Returns the trailing name component of a path. yii\helpers\BaseStringHelper
byteLength() Returns the number of bytes in the given string. yii\helpers\BaseStringHelper
byteSubstr() Returns the portion of string specified by the start and length parameters. yii\helpers\BaseStringHelper
countWords() Counts words in a string yii\helpers\BaseStringHelper
dirname() Returns parent directory's path. yii\helpers\BaseStringHelper
endsWith() Check if given string ends with specified substring. yii\helpers\BaseStringHelper
explode() Explodes string into array, optionally trims values and skips empty ones yii\helpers\BaseStringHelper
normalizeNumber() Returns string represenation of number value with replaced commas to dots, if decimal point of current locale is comma yii\helpers\BaseStringHelper
startsWith() Check if given string starts with specified substring. yii\helpers\BaseStringHelper
truncate() Truncates a string to the number of characters specified. yii\helpers\BaseStringHelper
truncateWords() Truncates a string to the number of words specified. yii\helpers\BaseStringHelper

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
truncateHtml() Truncate a string while preserving the HTML. yii\helpers\BaseStringHelper