{"id":13828513,"url":"https://github.com/fe3dback/str","last_synced_at":"2025-07-09T06:32:03.177Z","repository":{"id":53604095,"uuid":"122790849","full_name":"fe3dback/str","owner":"fe3dback","description":"A fast, solid and strong typed string manipulation library with multibyte support","archived":false,"fork":false,"pushed_at":"2021-03-21T19:50:05.000Z","size":362,"stargazers_count":189,"open_issues_count":2,"forks_count":12,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-05-17T00:32:12.568Z","etag":null,"topics":["library","multibyte","php","php-library","str","string","string-manipulation","stringy","utf-8"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fe3dback.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-25T00:00:10.000Z","updated_at":"2024-02-01T10:50:22.000Z","dependencies_parsed_at":"2022-08-24T07:30:43.846Z","dependency_job_id":null,"html_url":"https://github.com/fe3dback/str","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fe3dback%2Fstr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fe3dback%2Fstr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fe3dback%2Fstr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fe3dback%2Fstr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fe3dback","download_url":"https://codeload.github.com/fe3dback/str/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225492420,"owners_count":17482869,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["library","multibyte","php","php-library","str","string","string-manipulation","stringy","utf-8"],"created_at":"2024-08-04T09:02:50.117Z","updated_at":"2024-11-20T08:30:39.244Z","avatar_url":"https://github.com/fe3dback.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"## About\n\n# str/str\n\n[![Build Status](https://travis-ci.org/fe3dback/str.svg?branch=master)](https://travis-ci.org/fe3dback/str) \n[![Coverage Status](https://coveralls.io/repos/github/fe3dback/str/badge.svg?branch=master)](https://coveralls.io/github/fe3dback/str?branch=master)\n[![BCH compliance](https://bettercodehub.com/edge/badge/fe3dback/str?branch=master)](https://bettercodehub.com/)\n\n```php\n$str = new Str('Hello, 世界');\n$str-\u003elast(2); // 世界\n$str-\u003echars(); // ['世', '界']\n\n$str\n    -\u003eensureLeft('Hello, ') // Hello, 世界\n    -\u003eensureRight('!!!') // Hello, 世界!!!\n    -\u003etrimRight('!') // Hello, 世界\n    -\u003eprepend('Str say - '); // Str say - Hello, 世界\n\n$send = function (string $s) {};\n$send((string)$str); // same\n$send($str-\u003egetString()); // same\n```\n\n\n---------------------\n\n## Install\n\n__Requirements__:\n- php7.1\n\n```bash\ncomposer require str/str\n```\n\n## Features\n\n- [x] strongly typed\n- [x] no exceptions thrown\n- [x] fast\n- [x] new functions\n\nA fast string manipulation library with multi-byte support. \nInspired by the [\"Stringy\"](https://github.com/danielstjules/Stringy) library, with focus on speed.\n\nLib uses php7 features and does not throw any \nexceptions (because all input parameters are \nstrongly typed). The code is completely covered by unit tests.\n\n\n---------------------\n\n## Functions Index:\n\nA\n- \u003ca href=\"#afterfirst\"\u003eafterFirst\u003c/a\u003e\n- \u003ca href=\"#afterlast\"\u003eafterLast\u003c/a\u003e\n- \u003ca href=\"#append\"\u003eappend\u003c/a\u003e\n- \u003ca href=\"#appenduniqueidentifier\"\u003eappendUniqueIdentifier\u003c/a\u003e\n- \u003ca href=\"#at\"\u003eat\u003c/a\u003e\n\nB\n- \u003ca href=\"#beforefirst\"\u003ebeforeFirst\u003c/a\u003e\n- \u003ca href=\"#beforelast\"\u003ebeforeLast\u003c/a\u003e\n- \u003ca href=\"#between\"\u003ebetween\u003c/a\u003e\n\nC\n- \u003ca href=\"#camelize\"\u003ecamelize\u003c/a\u003e\n- \u003ca href=\"#chars\"\u003echars\u003c/a\u003e\n- \u003ca href=\"#chop\"\u003echop\u003c/a\u003e\n- \u003ca href=\"#collapsewhitespace\"\u003ecollapseWhitespace\u003c/a\u003e\n- \u003ca href=\"#contains\"\u003econtains\u003c/a\u003e\n- \u003ca href=\"#containsall\"\u003econtainsAll\u003c/a\u003e\n- \u003ca href=\"#containsany\"\u003econtainsAny\u003c/a\u003e\n- \u003ca href=\"#countsubstr\"\u003ecountSubstr\u003c/a\u003e\n\nD\n- \u003ca href=\"#dasherize\"\u003edasherize\u003c/a\u003e\n- \u003ca href=\"#delimit\"\u003edelimit\u003c/a\u003e\n\nE\n- \u003ca href=\"#endswith\"\u003eendsWith\u003c/a\u003e\n- \u003ca href=\"#endswithany\"\u003eendsWithAny\u003c/a\u003e\n- \u003ca href=\"#ensureleft\"\u003eensureLeft\u003c/a\u003e\n- \u003ca href=\"#ensureright\"\u003eensureRight\u003c/a\u003e\n\nF\n- \u003ca href=\"#first\"\u003efirst\u003c/a\u003e\n\nG\n- \u003ca href=\"#getstring\"\u003egetString\u003c/a\u003e\n\nH\n- \u003ca href=\"#haslowercase\"\u003ehasLowerCase\u003c/a\u003e\n- \u003ca href=\"#hasprefix\"\u003ehasPrefix\u003c/a\u003e\n- \u003ca href=\"#hassuffix\"\u003ehasSuffix\u003c/a\u003e\n- \u003ca href=\"#hasuppercase\"\u003ehasUpperCase\u003c/a\u003e\n- \u003ca href=\"#htmldecode\"\u003ehtmlDecode\u003c/a\u003e\n- \u003ca href=\"#htmlencode\"\u003ehtmlEncode\u003c/a\u003e\n- \u003ca href=\"#humanize\"\u003ehumanize\u003c/a\u003e\n\nI\n- \u003ca href=\"#indexof\"\u003eindexOf\u003c/a\u003e\n- \u003ca href=\"#indexoflast\"\u003eindexOfLast\u003c/a\u003e\n- \u003ca href=\"#insert\"\u003einsert\u003c/a\u003e\n- \u003ca href=\"#isalpha\"\u003eisAlpha\u003c/a\u003e\n- \u003ca href=\"#isalphanumeric\"\u003eisAlphanumeric\u003c/a\u003e\n- \u003ca href=\"#isbase64\"\u003eisBase64\u003c/a\u003e\n- \u003ca href=\"#isblank\"\u003eisBlank\u003c/a\u003e\n- \u003ca href=\"#isemail\"\u003eisEmail\u003c/a\u003e\n- \u003ca href=\"#ishexadecimal\"\u003eisHexadecimal\u003c/a\u003e\n- \u003ca href=\"#isipv4\"\u003eisIpV4\u003c/a\u003e\n- \u003ca href=\"#isipv6\"\u003eisIpV6\u003c/a\u003e\n- \u003ca href=\"#isjson\"\u003eisJson\u003c/a\u003e\n- \u003ca href=\"#islowercase\"\u003eisLowerCase\u003c/a\u003e\n- \u003ca href=\"#isserialized\"\u003eisSerialized\u003c/a\u003e\n- \u003ca href=\"#isuuidv4\"\u003eisUUIDv4\u003c/a\u003e\n- \u003ca href=\"#isuppercase\"\u003eisUpperCase\u003c/a\u003e\n\nJ\n- \u003ca href=\"#join\"\u003ejoin\u003c/a\u003e\n\nL\n- \u003ca href=\"#last\"\u003elast\u003c/a\u003e\n- \u003ca href=\"#length\"\u003elength\u003c/a\u003e\n- \u003ca href=\"#lines\"\u003elines\u003c/a\u003e\n- \u003ca href=\"#longestcommonprefix\"\u003elongestCommonPrefix\u003c/a\u003e\n- \u003ca href=\"#longestcommonsubstring\"\u003elongestCommonSubstring\u003c/a\u003e\n- \u003ca href=\"#longestcommonsuffix\"\u003elongestCommonSuffix\u003c/a\u003e\n- \u003ca href=\"#lowercasefirst\"\u003elowerCaseFirst\u003c/a\u003e\n\nM\n- \u003ca href=\"#make\"\u003emake\u003c/a\u003e\n- \u003ca href=\"#matchespattern\"\u003ematchesPattern\u003c/a\u003e\n- \u003ca href=\"#move\"\u003emove\u003c/a\u003e\n\nO\n- \u003ca href=\"#overwrite\"\u003eoverwrite\u003c/a\u003e\n\nP\n- \u003ca href=\"#padboth\"\u003epadBoth\u003c/a\u003e\n- \u003ca href=\"#padleft\"\u003epadLeft\u003c/a\u003e\n- \u003ca href=\"#padright\"\u003epadRight\u003c/a\u003e\n- \u003ca href=\"#pop\"\u003epop\u003c/a\u003e\n- \u003ca href=\"#popreversed\"\u003epopReversed\u003c/a\u003e\n- \u003ca href=\"#prepend\"\u003eprepend\u003c/a\u003e\n\nQ\n- \u003ca href=\"#quote\"\u003equote\u003c/a\u003e\n\nR\n- \u003ca href=\"#random\"\u003erandom\u003c/a\u003e\n- \u003ca href=\"#regexreplace\"\u003eregexReplace\u003c/a\u003e\n- \u003ca href=\"#removeleft\"\u003eremoveLeft\u003c/a\u003e\n- \u003ca href=\"#removeright\"\u003eremoveRight\u003c/a\u003e\n- \u003ca href=\"#repeat\"\u003erepeat\u003c/a\u003e\n- \u003ca href=\"#replace\"\u003ereplace\u003c/a\u003e\n- \u003ca href=\"#replacewithlimit\"\u003ereplaceWithLimit\u003c/a\u003e\n- \u003ca href=\"#reverse\"\u003ereverse\u003c/a\u003e\n\nS\n- \u003ca href=\"#safetruncate\"\u003esafeTruncate\u003c/a\u003e\n- \u003ca href=\"#shift\"\u003eshift\u003c/a\u003e\n- \u003ca href=\"#shiftreversed\"\u003eshiftReversed\u003c/a\u003e\n- \u003ca href=\"#shuffle\"\u003eshuffle\u003c/a\u003e\n- \u003ca href=\"#slice\"\u003eslice\u003c/a\u003e\n- \u003ca href=\"#slugify\"\u003eslugify\u003c/a\u003e\n- \u003ca href=\"#snakeize\"\u003esnakeize\u003c/a\u003e\n- \u003ca href=\"#split\"\u003esplit\u003c/a\u003e\n- \u003ca href=\"#startswith\"\u003estartsWith\u003c/a\u003e\n- \u003ca href=\"#startswithany\"\u003estartsWithAny\u003c/a\u003e\n- \u003ca href=\"#stripwhitespace\"\u003estripWhitespace\u003c/a\u003e\n- \u003ca href=\"#substr\"\u003esubstr\u003c/a\u003e\n- \u003ca href=\"#surround\"\u003esurround\u003c/a\u003e\n- \u003ca href=\"#swapcase\"\u003eswapCase\u003c/a\u003e\n\nT\n- \u003ca href=\"#tidy\"\u003etidy\u003c/a\u003e\n- \u003ca href=\"#titleize\"\u003etitleize\u003c/a\u003e\n- \u003ca href=\"#toascii\"\u003etoAscii\u003c/a\u003e\n- \u003ca href=\"#toboolean\"\u003etoBoolean\u003c/a\u003e\n- \u003ca href=\"#tolowercase\"\u003etoLowerCase\u003c/a\u003e\n- \u003ca href=\"#tospaces\"\u003etoSpaces\u003c/a\u003e\n- \u003ca href=\"#totabs\"\u003etoTabs\u003c/a\u003e\n- \u003ca href=\"#totitlecase\"\u003etoTitleCase\u003c/a\u003e\n- \u003ca href=\"#touppercase\"\u003etoUpperCase\u003c/a\u003e\n- \u003ca href=\"#trim\"\u003etrim\u003c/a\u003e\n- \u003ca href=\"#trimleft\"\u003etrimLeft\u003c/a\u003e\n- \u003ca href=\"#trimright\"\u003etrimRight\u003c/a\u003e\n- \u003ca href=\"#truncate\"\u003etruncate\u003c/a\u003e\n\nU\n- \u003ca href=\"#underscored\"\u003eunderscored\u003c/a\u003e\n- \u003ca href=\"#unquote\"\u003eunquote\u003c/a\u003e\n- \u003ca href=\"#uppercamelize\"\u003eupperCamelize\u003c/a\u003e\n- \u003ca href=\"#uppercasefirst\"\u003eupperCaseFirst\u003c/a\u003e\n\nW\n- \u003ca href=\"#words\"\u003ewords\u003c/a\u003e\n\n\n## Functions List:\n## afterFirst\nInserts given $substr $times into the original string after\nthe first occurrence of $needle.\n\n```php\n$str = new Str('foo bar baz');\necho (string)$str-\u003eafterFirst('a', 'duh', 2);\n// foo baduhduhr baz\n```\n\n**Parameters:**\n- string $needle \n- string $substr \n- int $times \n\n**Return:**\n- \\Str \n--------\n## afterLast\nInserts given $substr $times into the original string after\nthe last occurrence of $needle.\n\n```php\n$str = new Str('foo bar baz');\necho (string)$str-\u003eafterLast('a', 'duh', 2);\n// foo bar baduhduhz\n```\n\n**Parameters:**\n- string $needle \n- string $substr \n- int $times \n\n**Return:**\n- \\Str \n--------\n## append\nAppend $sub to the string.\n\n```php\n$str = new Str('/Acme');\necho (string)$str-\u003eappend('/');\n// /Acme/\n```\n\n**Parameters:**\n- string $sub \n\n**Return:**\n- \\Str \n--------\n## appendUniqueIdentifier\nAppends a random string consisting of $possibleChars, if specified, of given $size or\nrandom length between $size and $sizeMax to the original string.\n\n```php\n$str = new Str('foo');\necho $str-\u003eappendUniqueIdentifier(3, -1, 'foba_rz');\n// foozro\n```\n\n**Parameters:**\n- int $size \n- int $sizeMax \n- string $possibleChars \n\n**Return:**\n- \\Str \n--------\n## at\nReturns the character at $pos, with indexes starting at 0.\n\n```php\n$str = new Str('/Acme/');\necho (string)$str-\u003eat(2);\n// c\n```\n\n**Parameters:**\n- int $pos \n\n**Return:**\n- \\Str \n--------\n## beforeFirst\nInserts given $substr $times into the original string before\nthe first occurrence of $needle.\n\n```php\n$str = new Str('foo bar baz');\necho (string)$str-\u003ebeforeFirst('a', 'duh');\n// foo bduhar baz\n```\n\n**Parameters:**\n- string $needle \n- string $substr \n- int $times \n\n**Return:**\n- \\Str \n--------\n## beforeLast\nInserts given $substr $times into the original string before\nthe last occurrence of $needle.\n\n```php\n$str = new Str('foo bar baz');\necho (string)$str-\u003ebeforeLast('a', 'duh');\n// foo bar bduhaz\n```\n\n**Parameters:**\n- string $needle \n- string $substr \n- int $times \n\n**Return:**\n- \\Str \n--------\n## between\nReturns the substring between $start and $end, if found, or an empty string.\nAn optional $offset may be supplied from which to begin the search for the start string.\n\n```php\n$str = new Str('/Acme/');\necho (string)$str-\u003ebetween('/', '/');\n// Acme\n```\n\n**Parameters:**\n- string $start \n- string $end \n- int $offset \n\n**Return:**\n- \\Str \n--------\n## camelize\nReturns a camelCase version of the string. Trims surrounding spaces, capitalizes\nletters following digits, spaces, dashes and underscores, and removes spaces, dashes,\nas well as underscores.\n\n```php\n$str = new Str('ac me');\necho (string)$str-\u003ecamelize();\n// acMe\n```\n\n**Parameters:**\n__nothing__\n\n**Return:**\n- \\Str \n--------\n## chars\nReturns an array consisting of the characters in the string.\n\n```php\n$str = new Str('/Acme/');\necho (string)$str-\u003echars();\n// ['/', 'A', 'c', 'm', 'e', '/']\n```\n\n**Parameters:**\n__nothing__\n\n**Return:**\n- array \n--------\n## chop\nCuts the original string in pieces of $step size.\n\n```php\n$str = new Str('foo bar baz');\necho $str-\u003echop(2);\n// ['fo', 'o ', 'ba', 'r ', 'ba', 'z']\n```\n\n**Parameters:**\n- int $step \n\n**Return:**\n- array \n--------\n## collapseWhitespace\nTrims the string and replaces consecutive whitespace characters with a single space.\nThis includes tabs and newline characters, as well as multi-byte whitespace such as the\nthin space and ideographic space.\n\n```php\n$str = new Str('foo bar baz');\necho (string)$str-\u003ecollapseWhitespace();\n// foo bar baz\n```\n\n**Parameters:**\n__nothing__\n\n**Return:**\n- \\Str \n--------\n## contains\nCheck if the string contains $needle substring.\n\n```php\n$str = new Str('/Acme/');\necho $str-\u003econtains('/');\n// true\n$str = new Str('/Acme/');\necho $str-\u003econtains('a', false);\n// true\n```\n\n**Parameters:**\n- string $needle \n- bool $caseSensitive \n\n**Return:**\n- bool \n--------\n## containsAll\nReturns true if the string contains all $needles, false otherwise. By default\nthe comparison is case-sensitive, but can be made insensitive by setting $caseSensitive to false.\n\n```php\n$str = new Str('/Accmme/');\necho $str-\u003econtainsAll(['m', 'c', '/']);\n// true\n```\n\n**Parameters:**\n- array $needles \n- bool $caseSensitive \n\n**Return:**\n- bool \n--------\n## containsAny\nReturns true if the string contains any $needles, false otherwise. By default\nthe comparison is case-sensitive, but can be made insensitive by setting $caseSensitive to false.\n\n```php\n$str = new Str('/Accmme/');\necho $str-\u003econtainsAny(['foo', 'c', 'bar']);\n// true\n```\n\n**Parameters:**\n- array $needles \n- bool $caseSensitive \n\n**Return:**\n- bool \n--------\n## countSubstr\nReturns the number of occurrences of $needle in the given string. By default\nthe comparison is case-sensitive, but can be made insensitive by setting $caseSensitive to false.\n\n```php\n$str = new Str('/Accmme/');\necho $str-\u003ecountSubstr('m');\n// 2\n```\n\n**Parameters:**\n- string $needle \n- bool $caseSensitive \n\n**Return:**\n- int \n--------\n## dasherize\nReturns a lowercase and trimmed string separated by dashes. Dashes are inserted before\nuppercase characters (with the exception of the first character of the string),\nand in place of spaces as well as underscores.\n\n```php\n$str = new Str('Ac me');\necho (string)$str-\u003edasherize();\n// ac-me\n```\n\n**Parameters:**\n__nothing__\n\n**Return:**\n- \\Str \n--------\n## delimit\nReturns a lowercase and trimmed string separated by the given $delimiter. Delimiters\nare inserted before uppercase characters (with the exception of the first character of the\nstring), and in place of spaces, dashes, and underscores. Alpha delimiters are not converted\nto lowercase.\n\n```php\n$str = new Str('Ac me');\necho (string)$str-\u003edelimit('#');\n// ac#me\n```\n\n**Parameters:**\n- $delimiter \n\n**Return:**\n- \\Str \n--------\n## endsWith\nReturns true if the string ends with $substring, false otherwise. By default the comparison\nis case-sensitive, but can be made insensitive by setting $caseSensitive to false.\n\n```php\n$str = new Str('/Accmme/');\necho $str-\u003eendsWith('e/');\n// true\n```\n\n**Parameters:**\n- string $substring \n- bool $caseSensitive \n\n**Return:**\n- bool \n--------\n## endsWithAny\nReturns true if the string ends with any of $substrings, false otherwise. By default\nthe comparison is case-sensitive, but can be made insensitive by setting $caseSensitive to false.\n\n```php\n$str = new Str('/Accmme/');\necho $str-\u003eendsWithAny(['foo', 'e/', 'bar']);\n// true\n```\n\n**Parameters:**\n- array $substrings \n- bool $caseSensitive \n\n**Return:**\n- bool \n--------\n## ensureLeft\nCheck whether $prefix exists in the string, and prepend $prefix to the string if it doesn't.\n\n```php\n$str = new Str('Acme/');\necho (string)$str-\u003eensureLeft('/');\n// /Acme/\n$str = new Str('/Acme/');\necho (string)$str-\u003eensureLeft('/');\n// /Acme/\n```\n\n**Parameters:**\n- string $check \n\n**Return:**\n- \\Str \n--------\n## ensureRight\nCheck whether $suffix exists in the string, and append $suffix to the string if it doesn't.\n\n```php\n$str = new Str('/Acme');\necho (string)$str-\u003eensureRight('/'); // /Acme/\n$str = new Str('/Acme/');\necho (string)$str-\u003eensureRight('/'); // /Acme/\n```\n\n**Parameters:**\n- string $check \n\n**Return:**\n- \\Str \n--------\n## first\nReturns the first $length characters of the string.\n\n```php\n$str = new Str('/Acme/');\necho (string)$str-\u003efirst(2);\n// /A\n```\n\n**Parameters:**\n- int $length \n\n**Return:**\n- \\Str \n--------\n## getString\n\n\n**Parameters:**\n__nothing__\n\n**Return:**\n- string \n--------\n## hasLowerCase\nReturns true if the string contains a lower case char, false otherwise.\n\n```php\n$str = new Str('Acme');\necho $str-\u003ehasLowerCase();\n// true\n```\n\n**Parameters:**\n__nothing__\n\n**Return:**\n- bool \n--------\n## hasPrefix\nCheck if the string has $prefix at the start.\n\n```php\n$str = new Str('/Acme/');\necho $str-\u003ehasPrefix('/');\n// true\n```\n\n**Parameters:**\n- string $prefix \n\n**Return:**\n- bool \n--------\n## hasSuffix\nCheck if the string has $suffix at the end.\n\n```php\n$str = new Str('/Acme/');\necho $str-\u003ehasSuffix('/');\n// true\n```\n\n**Parameters:**\n- string $suffix \n\n**Return:**\n- bool \n--------\n## hasUpperCase\nReturns true if the string contains an upper case char, false otherwise.\n\n```php\n$str = new Str('Acme');\necho $str-\u003ehasUpperCase();\n// true\n```\n\n**Parameters:**\n__nothing__\n\n**Return:**\n- bool \n--------\n## htmlDecode\nConvert all HTML entities to their applicable characters. An alias of html_entity_decode.\nFor a list of flags, refer\nto [PHP documentation](http://php.net/manual/en/function.html-entity-decode.php).\n\n```php\n$str = new Str('\u0026lt;Acme\u0026gt;');\necho (string)$str-\u003ehtmlDecode();\n// \u003cAcme\u003e\n```\n\n**Parameters:**\n- int $flags \n\n**Return:**\n- \\Str \n--------\n## htmlEncode\nConvert all applicable characters to HTML entities. An alias of htmlentities.\nRefer to [PHP documentation](http://php.net/manual/en/function.htmlentities.php)\nfor a list of flags.\n\n```php\n$str = new Str('\u003cAcme\u003e');\necho (string)$str-\u003ehtmlEncode();\n// \u0026lt;Acme\u0026gt;\n```\n\n**Parameters:**\n- int $flags \n\n**Return:**\n- \\Str \n--------\n## humanize\nCapitalizes the first word of the string, replaces underscores with spaces.\n\n```php\n$str = new Str('foo_id');\necho (string)$str-\u003ehumanize();\n// Foo\n```\n\n**Parameters:**\n__nothing__\n\n**Return:**\n- \\Str \n--------\n## indexOf\nReturns the index of the first occurrence of $needle in the string, and -1 if not found.\nAccepts an optional $offset from which to begin the search.\n\n```php\n$str = new Str('/Accmme/');\necho $str-\u003eindexOf('m');\n// 4\n```\n\n**Parameters:**\n- string $needle \n- int $offset \n\n**Return:**\n- int \n--------\n## indexOfLast\nReturns the index of the last occurrence of $needle in the string, and false if not found.\nAccepts an optional $offset from which to begin the search. Offsets may be negative to\ncount from the last character in the string.\n\n```php\n$str = new Str('/Accmme/');\necho $str-\u003eindexOfLast('m');\n// 5\n```\n\n**Parameters:**\n- string $needle \n- int $offset \n\n**Return:**\n- int \n--------\n## insert\nInserts $substring into the string at the $index provided.\n\n```php\n$str = new Str('/Ace/');\necho (string)$str-\u003einsert('m', 3);\n// /Acme/\n```\n\n**Parameters:**\n- string $substring \n- int $index \n\n**Return:**\n- \\Str \n--------\n## isAlpha\nReturns true if the string contains only alphabetic chars, false otherwise.\n\n```php\n$str = new Str('Acme');\necho $str-\u003eisAlpha();\n// true\n```\n\n**Parameters:**\n__nothing__\n\n**Return:**\n- bool \n--------\n## isAlphanumeric\nReturns true if the string contains only alphabetic and numeric chars, false otherwise.\n\n```php\n$str = new Str('Acme1');\necho $str-\u003eisAlphanumeric();\n// true\n```\n\n**Parameters:**\n__nothing__\n\n**Return:**\n- bool \n--------\n## isBase64\nCheck if this string is valid base64 encoded\ndata. Function do encode(decode(s)) === s,\nso this is not so fast.\n\n**Parameters:**\n__nothing__\n\n**Return:**\n- bool \n--------\n## isBlank\nReturns true if the string contains only whitespace chars, false otherwise.\n\n```php\n$str = new Str('Acme');\necho $str-\u003eisBlank();\n// false\n```\n\n**Parameters:**\n__nothing__\n\n**Return:**\n- bool \n--------\n## isEmail\nSplits the original string in pieces by '@' delimiter and returns\ntrue in case the resulting array consists of 2 parts.\n\n```php\n$str = new Str('test@test@example.com');\necho $str-\u003eisEmail();\n// false\n```\n\n**Parameters:**\n__nothing__\n\n**Return:**\n- bool \n--------\n## isHexadecimal\nReturns true if the string contains only hexadecimal chars, false otherwise.\n\n```php\n$str = new Str('Acme');\necho $str-\u003eisHexadecimal();\n// false\n```\n\n**Parameters:**\n__nothing__\n\n**Return:**\n- bool \n--------\n## isIpV4\nReturn true if this is valid ipv4 address\n\n```php\n$str = new Str('1.0.1.0');\necho $str-\u003eisIpV4();\n// true\n```\n\n**Parameters:**\n__nothing__\n\n**Return:**\n- bool \n--------\n## isIpV6\nReturn true if this is valid ipv6 address\n\n```php\n$str = new Str('2001:cdba::3257:9652');\necho $str-\u003eisIpV6();\n// true\n```\n\n**Parameters:**\n__nothing__\n\n**Return:**\n- bool \n--------\n## isJson\nReturns true if the string is JSON, false otherwise. Unlike json_decode in PHP 5.x,\nthis method is consistent with PHP 7 and other JSON parsers, in that an empty string\nis not considered valid JSON.\n\n```php\n$str = new Str('Acme');\necho $str-\u003eisJson();\n// false\n```\n\n**Parameters:**\n__nothing__\n\n**Return:**\n- bool \n--------\n## isLowerCase\nReturns true if the string contains only lower case chars, false otherwise.\n\n```php\n$str = new Str('Acme');\necho $str-\u003eisLowerCase();\n// false\n```\n\n**Parameters:**\n__nothing__\n\n**Return:**\n- bool \n--------\n## isSerialized\nReturns true if the string is serialized, false otherwise.\n\n```php\n$str = new Str('Acme');\necho $str-\u003eisSerialized();\n// false\n```\n\n**Parameters:**\n__nothing__\n\n**Return:**\n- bool \n--------\n## isUUIDv4\nIt doesn't matter whether the given UUID has dashes.\n\n```php\n$str = new Str('76d7cac8-1bd7-11e8-accf-0ed5f89f718b');\necho $str-\u003eisUUIDv4();\n// false\n$str = new Str('ae815123-537f-4eb3-a9b8-35881c29e1ac');\necho $str-\u003eisUUIDv4();\n// true\n```\n\n**Parameters:**\n__nothing__\n\n**Return:**\n- bool \n--------\n## isUpperCase\nReturns true if the string contains only upper case chars, false otherwise.\n\n```php\n$str = new Str('Acme');\necho $str-\u003eisUpperCase();\n// false\n```\n\n**Parameters:**\n__nothing__\n\n**Return:**\n- bool \n--------\n## join\nJoins the original string with an array of other strings with the given $separator.\n\n```php\n$str = new Str('foo');\necho $str-\u003ejoin('*', ['bar', 'baz']);\n// foo*bar*baz\n```\n\n**Parameters:**\n- string $separator \n- array $otherStrings \n\n**Return:**\n- \\Str \n--------\n## last\nReturns the first $length characters of the string.\n\n```php\n$str = new Str('/Acme/');\necho (string)$str-\u003elast(2);\n// e/\n```\n\n**Parameters:**\n- int $length \n\n**Return:**\n- \\Str \n--------\n## length\nReturns the length of the string.\n\n```php\n$str = new Str('/Acme/');\necho $str-\u003elength();\n// 6\n```\n\n**Parameters:**\n__nothing__\n\n**Return:**\n- int \n--------\n## lines\nSplits on newlines and carriage returns, returning an array of strings\ncorresponding to the lines in the string.\n\n```php\n$str = new Str(\"Acme\\r\\nAcme\");\necho $str-\u003elines();\n// ['Acme', 'Acme']\n```\n\n**Parameters:**\n__nothing__\n\n**Return:**\n- array \n--------\n## longestCommonPrefix\nReturns the longest common prefix between the string and $otherStr.\n\n```php\n$str = new Str('Acme');\necho (string)$str-\u003elongestCommonPrefix('Accurate');\n// Ac\n```\n\n**Parameters:**\n- string $otherStr \n\n**Return:**\n- \\Str \n--------\n## longestCommonSubstring\nReturns the longest common substring between the string and $otherStr.\nIn the case of ties, it returns that which occurs first.\n\n```php\n$str = new Str('Acme');\necho (string)$str-\u003elongestCommonSubstring('meh');\n// me\n```\n\n**Parameters:**\n- string $otherStr \n\n**Return:**\n- \\Str \n--------\n## longestCommonSuffix\nReturns the longest common suffix between the string and $otherStr.\n\n```php\n$str = new Str('Acme');\necho (string)$str-\u003elongestCommonSuffix('Do believe me');\n// me\n```\n\n**Parameters:**\n- string $otherStr \n\n**Return:**\n- \\Str \n--------\n## lowerCaseFirst\nConverts the first character of the string to lower case.\n\n```php\n$str = new Str('Acme Foo');\necho (string)$str-\u003elowerCaseFirst();\n// acme Foo\n```\n\n**Parameters:**\n__nothing__\n\n**Return:**\n- \\Str \n--------\n## make\nCreate a new Str object using static method for it.\n\n```php\n$str = Str::make('Acme');\necho (string)$str; // Acme\n```\n\n**Parameters:**\n- string $str \n\n**Return:**\n- \\Str \n--------\n## matchesPattern\nReturns true if the string match regexp pattern\n\n```php\n$s = new Str('foo baR');\necho $str-\u003ematchesPattern('.*aR');\n// true\n```\n\n**Parameters:**\n- string $pattern \n\n**Return:**\n- bool \n--------\n## move\nMove substring of desired $length to $destination index of the original string.\nIn case $destination is less than $length returns the string untouched.\n\n```php\n$str = new Str('/Acme/');\necho (string)$str-\u003emove(0, 2, 4);\n// cm/Ae/\n```\n\n**Parameters:**\n- int $start \n- int $length \n- int $destination \n\n**Return:**\n- \\Str \n--------\n## overwrite\nReplaces substring in the original string of $length with given $substr.\n\n```php\n$str = new Str('/Acme/');\necho (string)$str-\u003eoverwrite(0, 2, 'BAR');\n// BARcme/\n```\n\n**Parameters:**\n- int $start \n- int $length \n- string $substr \n\n**Return:**\n- \\Str \n--------\n## padBoth\nReturns a new string of a given length such that both sides of the string are padded.\n\n```php\n$str = new Str('Acme');\necho (string)$str-\u003epadBoth(6, '/');\n// /Acme/\n```\n\n**Parameters:**\n- int $length \n- string $padStr \n\n**Return:**\n- \\Str \n--------\n## padLeft\nReturns a new string of a given length such that the beginning of the string is padded.\n\n```php\n$str = new Str('Acme/');\necho (string)$str-\u003epadLeft(6, '/');\n// /Acme/\n```\n\n**Parameters:**\n- int $length \n- string $padStr \n\n**Return:**\n- \\Str \n--------\n## padRight\nReturns a new string of a given length such that the end of the string is padded.\n\n```php\n$str = new Str('/Acme');\necho (string)$str-\u003epadRight(6, '/');\n// /Acme/\n```\n\n**Parameters:**\n- int $length \n- string $padStr \n\n**Return:**\n- \\Str \n--------\n## pop\nReturns the substring of the string from the last occurrence of $delimiter to the end.\n\n```php\n$str = new Str('Acme/foo');\necho $str-\u003epop('/');\n// foo\n```\n\n**Parameters:**\n- string $delimiter \n\n**Return:**\n- \\Str \n--------\n## popReversed\nReturns the substring of the original string from the beginning\nto the last occurrence of $delimiter.\n\n```php\n$str = new Str('Acme/foo/bar');\necho $str-\u003epopReversed('/');\n// Acme/foo\n```\n\n**Parameters:**\n- string $delimiter \n\n**Return:**\n- \\Str \n--------\n## prepend\nPrepend $sub to the string.\n\n```php\n$str = new Str('Acme/');\necho (string)$str-\u003eprepend('/');\n// /Acme/\n```\n\n**Parameters:**\n- string $sub \n\n**Return:**\n- \\Str \n--------\n## quote\nWraps each word in the string with specified $quote.\n\n```php\n$str = new Str('foo bar baz');\necho $str-\u003equote('*');\n// *foo* *bar* *baz*\n```\n\n**Parameters:**\n- string $quote \n\n**Return:**\n- \\Str \n--------\n## random\nGenerates a random string consisting of $possibleChars, if specified, of given $size or\nrandom length between $size and $sizeMax. If $possibleChars is not specified, the generated string\nwill consist of ASCII alphanumeric chars.\n\n```php\n$str = new Str('foo bar');\necho $str-\u003erandom(3, -1, 'fobarz');\n// zfa\n$str = new Str('');\necho $str-\u003erandom(3);\n// 1ho\n```\n\n**Parameters:**\n- int $size \n- int $sizeMax \n- string $possibleChars \n\n**Return:**\n- \\Str \n--------\n## regexReplace\nReplaces all occurrences of $pattern in the string by $replacement.\nAn alias for mb_ereg_replace(). Note that the 'i' option with multi-byte patterns in\nmb_ereg_replace() requires PHP 5.6+ for correct results. This is due to a lack of support in\nthe bundled version of Oniguruma in PHP \u003c 5.6, and current versions of HHVM (3.8 and below).\n\n```php\n$str = new Str('Acme Foo');\necho (string)$str-\u003eregexReplace('A', 'a');\n// acme Foo\n```\n\n**Parameters:**\n- string $pattern \n- string $replacement \n- string $options \n\n**Return:**\n- \\Str \n--------\n## removeLeft\nReturns the string with the prefix $substring removed, if present.\n\n```php\n$str = new Str('/Acme/');\necho (string)$str-\u003eremoveLeft('/');\n// Acme/\n```\n\n**Parameters:**\n- string $substring \n\n**Return:**\n- \\Str \n--------\n## removeRight\nReturns the string with the suffix $substring removed, if present.\n\n```php\n$str = new Str('/Acme/');\necho (string)$str-\u003eremoveRight('/');\n// /Acme\n```\n\n**Parameters:**\n- string $substring \n\n**Return:**\n- \\Str \n--------\n## repeat\nReturns a repeated string given a $multiplier. An alias for str_repeat.\n\n```php\n$str = new Str('Acme/');\necho (string)$str-\u003erepeat(2);\n// Acme/Acme/\n```\n\n**Parameters:**\n- int $multiplier \n\n**Return:**\n- \\Str \n--------\n## replace\nReplaces all occurrences of $old in the string by $new.\n\n```php\n$str = new Str('/Acme/');\necho (string)$str-\u003ereplace('/', '#');\n// #Acme#\n```\n\n**Parameters:**\n- string $old \n- string $new \n\n**Return:**\n- \\Str \n--------\n## replaceWithLimit\nReplace returns a copy of the string s with the first n non-overlapping instances of\nold replaced by new. If old is empty, it matches at the beginning of the string and\nafter each UTF-8 sequence, yielding up to k+1 replacements for a k-rune string.\nIf n \u003c 0, there is no limit on the number of replacements.\n\n```php\n$str = new Str('/Acme/');\necho (string)$str-\u003ereplaceWithLimit('/', '#', 1);\n// #Acme/\n```\n\n**Parameters:**\n- string $old \n- string $new \n- int $limit \n\n**Return:**\n- \\Str \n--------\n## reverse\nReturns a reversed string. A multi-byte version of strrev().\n\n```php\n$str = new Str('/Acme/');\necho (string)$str-\u003ereverse();\n// /emcA/\n```\n\n**Parameters:**\n__nothing__\n\n**Return:**\n- \\Str \n--------\n## safeTruncate\nTruncates the string to a given $length, while ensuring that it does not split words.\nIf $substring is provided, and truncating occurs, the string is further truncated\nso that the $substring may be appended without exceeding the desired length.\n\n```php\n$str = new Str('What are your plans today?');\necho (string)$str-\u003esafeTruncate(22, '...');\n// What are your plans...\n```\n\n**Parameters:**\n- int $length \n- string $substring \n\n**Return:**\n- \\Str \n--------\n## shift\nReturns the substring of the original string from beginning to the first occurrence\nof $delimiter.\n\n```php\n$str = new Str('Acme/foo');\necho $str-\u003eshift('/');\n// Acme\n```\n\n**Parameters:**\n- string $delimiter \n\n**Return:**\n- \\Str \n--------\n## shiftReversed\nReturns the substring of the original string from the first occurrence of $delimiter to the end.\n\n```php\n$str = new Str('Acme/foo/bar');\necho $str-\u003eshiftReversed('/');\n// foo/bar\n```\n\n**Parameters:**\n- string $delimiter \n\n**Return:**\n- \\Str \n--------\n## shuffle\nA multi-byte str_shuffle() function. It returns a string with its characters in random order.\n\n```php\n$str = new Str('/Acme/');\necho (string)$str-\u003eshuffle();\n// mAe//c\n```\n\n**Parameters:**\n__nothing__\n\n**Return:**\n- \\Str \n--------\n## slice\nReturns the substring beginning at $start, and up to, but not including the index\nspecified by $end. If $end is omitted, the function extracts the remaining string.\nIf $end is negative, it is computed from the end of the string.\n\n```php\n$str = new Str('Acme');\necho (string)$str-\u003eslice(2);\n// me\n```\n\n**Parameters:**\n- int $start \n- int|null $end \n\n**Return:**\n- \\Str \n--------\n## slugify\nConverts the string into an URL slug. This includes replacing non-ASCII characters with\ntheir closest ASCII equivalents, removing remaining non-ASCII and non-alphanumeric characters,\nand replacing whitespace with $replacement. The $replacement defaults to a single dash, and\nthe string is also converted to lowercase. The $language of the source string can also be\nsupplied for language-specific transliteration.\n\n```php\n$str = new Str('Acme foo bar!');\necho (string)$str-\u003eslugify();\n// acme-foo-bar\n```\n\n**Parameters:**\n- string $replacement \n- string $language \n\n**Return:**\n- \\Str \n--------\n## snakeize\nReturns a snake_case version of the string.\n\n```php\n$str = new Str('Foo Bar');\necho (string)$str-\u003esnakeize();\n// foo_bar\n```\n\n**Parameters:**\n__nothing__\n\n**Return:**\n- \\Str \n--------\n## split\nSplits the string with the provided $pattern, returning an array of strings.\nAn optional integer $limit will truncate the results.\n\n```php\n$str = new Str('Acme#Acme');\necho $str-\u003esplit('#', 1);\n// ['Acme']\n```\n\n**Parameters:**\n- string $pattern \n- int $limit \n\n**Return:**\n- array \n--------\n## startsWith\nReturns true if the string begins with $substring, false otherwise. By default\nthe comparison is case-sensitive, but can be made insensitive by setting $caseSensitive to false.\n\n```php\n$str = new Str('/Accmme/');\necho $str-\u003estartsWith('/A');\n// true\n```\n\n**Parameters:**\n- string $substring \n- bool $caseSensitive \n\n**Return:**\n- bool \n--------\n## startsWithAny\nReturns true if the string begins with any of $substrings, false otherwise. By default\nthe comparison is case-sensitive, but can be made insensitive by setting $caseSensitive to false.\n\n```php\n$str = new Str('/Accmme/');\necho $str-\u003estartsWithAny(['foo', '/A', 'bar']);\n// true\n```\n\n**Parameters:**\n- array $substrings \n- bool $caseSensitive \n\n**Return:**\n- bool \n--------\n## stripWhitespace\nStrip all whitespace characters. This includes tabs and newline characters,\nas well as multi-byte whitespace such as the thin space and ideographic space.\n\n```php\n$str = new Str('Acme foo');\necho (string)$str-\u003estripWhitespace();\n// Acmefoo\n```\n\n**Parameters:**\n__nothing__\n\n**Return:**\n- \\Str \n--------\n## substr\nReturns the substring beginning at $start with the specified $length.\nIt differs from the mb_substr() function in that providing a $length of 0 will\nreturn the rest of the string, rather than an empty string.\n\n```php\n$str = new Str('/Acme/');\necho (string)$str-\u003esubstr(1, 4);\n// Acme\n```\n\n**Parameters:**\n- int $start \n- int $length \n\n**Return:**\n- \\Str \n--------\n## surround\nSurrounds the string with the given $substring.\n\n```php\n$str = new Str('Acme');\necho (string)$str-\u003esurround('/');\n// /Acme/\n```\n\n**Parameters:**\n- string $substring \n\n**Return:**\n- \\Str \n--------\n## swapCase\nReturns a case swapped version of the string.\n\n```php\n$str = new Str('foObARbAz');\necho (string)$str-\u003eswapCase();\n// FOoBarBaZ\n```\n\n**Parameters:**\n__nothing__\n\n**Return:**\n- \\Str \n--------\n## tidy\nReturns a string with smart quotes, ellipsis characters, and dashes from Windows-1252\n(commonly used in Word documents) replaced by their ASCII equivalents.\n\n```php\n$str = new Str('“I see…”');\necho (string)$str-\u003etidy();\n// \"I see...\"\n```\n\n**Parameters:**\n__nothing__\n\n**Return:**\n- \\Str \n--------\n## titleize\nReturns a trimmed string with the first letter of each word capitalized.\nAlso accepts an array, $ignore, allowing you to list words not to be capitalized.\n\n```php\n$str = new Str('i like to watch DVDs at home');\necho (string)$str-\u003etitleize(['at', 'to', 'the']);\n// I Like to Watch Dvds at Home\n```\n\n**Parameters:**\n- array $ignore \n\n**Return:**\n- \\Str \n--------\n## toAscii\nReturns an ASCII version of the string. A set of non-ASCII characters are replaced with\ntheir closest ASCII counterparts, and the rest are removed by default. The $language or\nlocale of the source string can be supplied for language-specific transliteration in\nany of the following formats: en, en_GB, or en-GB. For example, passing \"de\" results\nin \"äöü\" mapping to \"aeoeue\" rather than \"aou\" as in other languages.\n\n```php\n$str = new Str('Äcmế');\necho (string)$str-\u003etoAscii();\n// Acme\n```\n\n**Parameters:**\n- string $language \n- bool $removeUnsupported \n\n**Return:**\n- \\Str \n--------\n## toBoolean\nReturns a boolean representation of the given logical string value. For example,\n'true', '1', 'on' and 'yes' will return true. 'false', '0', 'off', and 'no' will\nreturn false. In all instances, case is ignored. For other numeric strings, their\nsign will determine the return value. In addition, blank strings consisting of only\nwhitespace will return false. For all other strings, the return value is a result of\na boolean cast.\n\n```php\n$str = new Str('yes');\necho $str-\u003etoBoolean();\n// true\n```\n\n**Parameters:**\n__nothing__\n\n**Return:**\n- bool \n--------\n## toLowerCase\nMake the string lowercase.\n\n```php\n$str = new Str('/Acme/');\necho (string)$str-\u003etoLowerCase();\n// /acme/\n```\n\n**Parameters:**\n__nothing__\n\n**Return:**\n- \\Str \n--------\n## toSpaces\nConverts each tab in the string to some number of spaces, as defined by $tabLength.\nBy default, each tab is converted to 4 consecutive spaces.\n\n```php\n$str = new Str('foo    bar');\necho (string)$str-\u003etoSpaces(0);\n// foobar\n```\n\n**Parameters:**\n- int $tabLength \n\n**Return:**\n- \\Str \n--------\n## toTabs\nConverts each occurrence of some consecutive number of spaces, as defined by $tabLength,\nto a tab. By default, each 4 consecutive spaces are converted to a tab.\n\n```php\n$str = new Str('foo bar');\necho (string)$str-\u003etoTabs();\n// foo    bar\n```\n\n**Parameters:**\n- int $tabLength \n\n**Return:**\n- \\Str \n--------\n## toTitleCase\nConverts the first character of each word in the string to uppercase.\n\n```php\n$str = new Str('foo bar baz');\necho (string)$str-\u003etoTitleCase();\n// Foo Bar Baz\n```\n\n**Parameters:**\n__nothing__\n\n**Return:**\n- \\Str \n--------\n## toUpperCase\nMake the string uppercase.\n\n```php\n$str = new Str('/Acme/');\necho (string)$str-\u003etoUpperCase();\n// /ACME/\n```\n\n**Parameters:**\n__nothing__\n\n**Return:**\n- \\Str \n--------\n## trim\nReturns a string with whitespace removed from the start and end of the string.\nSupports the removal of unicode whitespace. Accepts an optional string of characters\nto strip instead of the defaults.\n\n```php\n$str = new Str('/Acme/');\necho (string)$str-\u003etrim('/');\n// Acme\n```\n\n**Parameters:**\n- string $chars \n\n**Return:**\n- \\Str \n--------\n## trimLeft\nReturns a string with whitespace removed from the start of the string.\nSupports the removal of unicode whitespace. Accepts an optional string of characters\nto strip instead of the defaults.\n\n```php\n$str = new Str('/Acme/');\necho (string)$str-\u003etrimLeft('/');\n// Acme/\n```\n\n**Parameters:**\n- string $chars \n\n**Return:**\n- \\Str \n--------\n## trimRight\nReturns a string with whitespace removed from the end of the string.\nSupports the removal of unicode whitespace. Accepts an optional string of characters\nto strip instead of the defaults.\n\n```php\n$str = new Str('/Acme/');\necho (string)$str-\u003etrimRight('/');\n// /Acme\n```\n\n**Parameters:**\n- string $chars \n\n**Return:**\n- \\Str \n--------\n## truncate\nTruncates the string to a given $length. If $substring is provided, and truncating\noccurs, the string is further truncated so that the substring may be appended\nwithout exceeding the desired length.\n\n```php\n$str = new Str('What are your plans today?');\necho (string)$str-\u003etruncate(19, '...');\n// What are your pl...\n```\n\n**Parameters:**\n- int $length \n- string $substring \n\n**Return:**\n- \\Str \n--------\n## underscored\nReturns a lowercase and trimmed string separated by underscores. Underscores\nare inserted before uppercase characters (with the exception of the first\ncharacter of the string), and in place of spaces as well as dashes.\n\n```php\n$str = new Str('foo Bar baz');\necho (string)$str-\u003eunderscored();\n// foo_bar_baz\n```\n\n**Parameters:**\n__nothing__\n\n**Return:**\n- \\Str \n--------\n## unquote\nUnwraps each word in the original string, deleting the specified $quote.\n\n```php\n$str = new Str('*foo* bar* ***baz*');\necho $str-\u003eunquote('*');\n// foo bar baz\n```\n\n**Parameters:**\n- string $quote \n\n**Return:**\n- \\Str \n--------\n## upperCamelize\nReturns an UpperCamelCase version of the string. It trims surrounding spaces,\ncapitalizes letters following digits, spaces, dashes and underscores,\nand removes spaces, dashes, underscores.\n\n```php\n$str = new Str('foo bar baz');\necho (string)$str-\u003eupperCamelize();\n// FooBarBaz\n```\n\n**Parameters:**\n__nothing__\n\n**Return:**\n- \\Str \n--------\n## upperCaseFirst\nConverts the first character of the string to upper case.\n\n```php\n$str = new Str('acme foo');\necho (string)$str-\u003eupperCaseFirst();\n// Acme foo\n```\n\n**Parameters:**\n__nothing__\n\n**Return:**\n- \\Str \n--------\n## words\nSplits on whitespace, returning an array of strings corresponding to the words in the string.\n\n```php\n$str = new Str('foo bar baz');\necho $str-\u003ewords();\n// ['foo', 'bar', 'baz']\n```\n\n**Parameters:**\n__nothing__\n\n**Return:**\n- array \n--------\n\n---------------------\n\n## Benchmark\n\nlib code tests (versus):\n```bash\nmake lib-code-tests\n```\n\nhow to get total RANK:\n```bash\nmake rank\n```\n\ngenerate md:\n```bash\nmake md\n```\n\nrun tests:\n```bash\nmake test\n```\n\nTest subjects:\n- FS ([str/str](https://github.com/fe3dback/str))\n- Stringy ([danielstjules/Stringy](https://github.com/danielstjules/Stringy))\n\n----\n\nRANK (sum time of all benchmarks): \n__smaller - is better!__\n\nTarget  | Total Time | Diff\n---     | ---        | ---\nStr     | 5.505 s.   | 1x\nStringy | 10.840 s.  | 2.0x\n\n----\n\nsubject | mode | mem_peak | diff\n --- | --- | --- | --- \nbench_common_Str | 811.098μs | 1,929,728b | 1.00x\nbench_common_Stringy | 5,310.290μs | 1,879,272b | 6.55x\n\n##### [see all other benchmark results](https://github.com/fe3dback/str/blob/master/docs/benchmark.md)\n\n\n## Development\n\nPlease use php cs fixer before commit:\nhttps://github.com/FriendsOfPHP/PHP-CS-Fixer\n\nyou can add watcher in any IDE for automatic fix code\nstyle on save.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffe3dback%2Fstr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffe3dback%2Fstr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffe3dback%2Fstr/lists"}