# StringHelper

> StringHelper.

[API reference](/docs/api/index.md) › [yii](/docs/api/yii/index.md) › [helpers](/docs/api/yii/helpers/index.md) › StringHelper

| class | `yii\helpers\StringHelper` |
| --- | --- |
| Extends | [`BaseStringHelper`](/docs/api/yii/helpers/basestringhelper/index.md) |
| Since | 2.0 |
| Source | [`framework/helpers/StringHelper.php`](https://github.com/yiisoft/yii2/blob/22.0/framework/helpers/StringHelper.php#L18) |

StringHelper.

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| <span id="method-base64UrlDecode"></span>[`base64UrlDecode()`](/docs/api/yii/helpers/basestringhelper/index.md#method-base64UrlDecode) static | Decodes "Base 64 Encoding with URL and Filename Safe Alphabet" (RFC 4648). | [`BaseStringHelper`](/docs/api/yii/helpers/basestringhelper/index.md) |
| <span id="method-base64UrlEncode"></span>[`base64UrlEncode()`](/docs/api/yii/helpers/basestringhelper/index.md#method-base64UrlEncode) static | Encodes string into "Base 64 Encoding with URL and Filename Safe Alphabet" (RFC 4648). | [`BaseStringHelper`](/docs/api/yii/helpers/basestringhelper/index.md) |
| <span id="method-basename"></span>[`basename()`](/docs/api/yii/helpers/basestringhelper/index.md#method-basename) static | Returns the trailing name component of a path. | [`BaseStringHelper`](/docs/api/yii/helpers/basestringhelper/index.md) |
| <span id="method-byteLength"></span>[`byteLength()`](/docs/api/yii/helpers/basestringhelper/index.md#method-byteLength) static | Returns the number of bytes in the given string. | [`BaseStringHelper`](/docs/api/yii/helpers/basestringhelper/index.md) |
| <span id="method-byteSubstr"></span>[`byteSubstr()`](/docs/api/yii/helpers/basestringhelper/index.md#method-byteSubstr) static | Returns the portion of string specified by the start and length parameters. | [`BaseStringHelper`](/docs/api/yii/helpers/basestringhelper/index.md) |
| <span id="method-convertIniSizeToBytes"></span>[`convertIniSizeToBytes()`](/docs/api/yii/helpers/basestringhelper/index.md#method-convertIniSizeToBytes) static | Converts php.ini style size to bytes. | [`BaseStringHelper`](/docs/api/yii/helpers/basestringhelper/index.md) |
| <span id="method-countWords"></span>[`countWords()`](/docs/api/yii/helpers/basestringhelper/index.md#method-countWords) static | Counts words in a string. | [`BaseStringHelper`](/docs/api/yii/helpers/basestringhelper/index.md) |
| <span id="method-dirname"></span>[`dirname()`](/docs/api/yii/helpers/basestringhelper/index.md#method-dirname) static | Returns parent directory's path. | [`BaseStringHelper`](/docs/api/yii/helpers/basestringhelper/index.md) |
| <span id="method-endsWith"></span>[`endsWith()`](/docs/api/yii/helpers/basestringhelper/index.md#method-endsWith) static | Check if given string ends with specified substring. Binary and multibyte safe. | [`BaseStringHelper`](/docs/api/yii/helpers/basestringhelper/index.md) |
| <span id="method-explode"></span>[`explode()`](/docs/api/yii/helpers/basestringhelper/index.md#method-explode) static | Explodes string into array, optionally trims values and skips empty ones. | [`BaseStringHelper`](/docs/api/yii/helpers/basestringhelper/index.md) |
| <span id="method-findBetween"></span>[`findBetween()`](/docs/api/yii/helpers/basestringhelper/index.md#method-findBetween) static | Returns the portion of the string that lies between the first occurrence of the start string and the last occurrence of the end string after that. | [`BaseStringHelper`](/docs/api/yii/helpers/basestringhelper/index.md) |
| <span id="method-floatToString"></span>[`floatToString()`](/docs/api/yii/helpers/basestringhelper/index.md#method-floatToString) static | Safely casts a float to string independent of the current locale. | [`BaseStringHelper`](/docs/api/yii/helpers/basestringhelper/index.md) |
| <span id="method-mask"></span>[`mask()`](/docs/api/yii/helpers/basestringhelper/index.md#method-mask) static | Masks a portion of a string with a repeated character. | [`BaseStringHelper`](/docs/api/yii/helpers/basestringhelper/index.md) |
| <span id="method-matchWildcard"></span>[`matchWildcard()`](/docs/api/yii/helpers/basestringhelper/index.md#method-matchWildcard) static | Checks if the passed string would match the given shell wildcard pattern. | [`BaseStringHelper`](/docs/api/yii/helpers/basestringhelper/index.md) |
| <span id="method-mb_ucfirst"></span>[`mb_ucfirst()`](/docs/api/yii/helpers/basestringhelper/index.md#method-mb_ucfirst) static | This method provides a unicode-safe implementation of built-in PHP function `ucfirst()`. | [`BaseStringHelper`](/docs/api/yii/helpers/basestringhelper/index.md) |
| <span id="method-mb_ucwords"></span>[`mb_ucwords()`](/docs/api/yii/helpers/basestringhelper/index.md#method-mb_ucwords) static | This method provides a unicode-safe implementation of built-in PHP function `ucwords()`. | [`BaseStringHelper`](/docs/api/yii/helpers/basestringhelper/index.md) |
| <span id="method-normalizeNumber"></span>[`normalizeNumber()`](/docs/api/yii/helpers/basestringhelper/index.md#method-normalizeNumber) static | Returns string representation of number value with replaced commas to dots, if decimal point of current locale is comma. | [`BaseStringHelper`](/docs/api/yii/helpers/basestringhelper/index.md) |
| <span id="method-startsWith"></span>[`startsWith()`](/docs/api/yii/helpers/basestringhelper/index.md#method-startsWith) static | Check if given string starts with specified substring. Binary and multibyte safe. | [`BaseStringHelper`](/docs/api/yii/helpers/basestringhelper/index.md) |
| <span id="method-truncate"></span>[`truncate()`](/docs/api/yii/helpers/basestringhelper/index.md#method-truncate) static | Truncates a string to the number of characters specified. | [`BaseStringHelper`](/docs/api/yii/helpers/basestringhelper/index.md) |
| <span id="method-truncateWords"></span>[`truncateWords()`](/docs/api/yii/helpers/basestringhelper/index.md#method-truncateWords) static | Truncates a string to the number of words specified. | [`BaseStringHelper`](/docs/api/yii/helpers/basestringhelper/index.md) |
| <span id="method-truncateHtml"></span>[`truncateHtml()`](/docs/api/yii/helpers/basestringhelper/index.md#method-truncateHtml) protected static | Truncate a string while preserving the HTML. | [`BaseStringHelper`](/docs/api/yii/helpers/basestringhelper/index.md) |