{"id":21807448,"url":"https://github.com/vantoozz/strings","last_synced_at":"2025-08-08T15:40:00.599Z","repository":{"id":57076925,"uuid":"109997220","full_name":"vantoozz/strings","owner":"vantoozz","description":"Library for strings manipulations","archived":false,"fork":false,"pushed_at":"2020-11-15T16:20:38.000Z","size":78,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-26T04:43:15.761Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/vantoozz.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":"2017-11-08T15:57:07.000Z","updated_at":"2020-11-15T16:20:40.000Z","dependencies_parsed_at":"2022-08-24T14:55:57.033Z","dependency_job_id":null,"html_url":"https://github.com/vantoozz/strings","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vantoozz%2Fstrings","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vantoozz%2Fstrings/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vantoozz%2Fstrings/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vantoozz%2Fstrings/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vantoozz","download_url":"https://codeload.github.com/vantoozz/strings/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244759961,"owners_count":20505716,"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":[],"created_at":"2024-11-27T12:41:26.099Z","updated_at":"2025-03-21T08:14:22.025Z","avatar_url":"https://github.com/vantoozz.png","language":"PHP","readme":"# Strings\nTrue OOP library for strings manipulation\n\n[![Build Status](https://travis-ci.org/vantoozz/strings.svg?branch=master)](https://travis-ci.org/vantoozz/strings)\n[![Coverage Status](https://coveralls.io/repos/github/vantoozz/strings/badge.svg?branch=master)](https://coveralls.io/github/vantoozz/strings?branch=master)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/724532697bb642b293e4f8a3b462a8ee)](https://app.codacy.com/manual/vantoozz/strings?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=vantoozz/strings\u0026utm_campaign=Badge_Grade_Settings)\n[![Packagist](https://img.shields.io/packagist/v/vantoozz/strings.svg)](https://packagist.org/packages/vantoozz/strings)\n\n\n\nThe goal of the library is providing an OOP way for strings manipulations. \nIt works  with any object implementing `Stringable` interface. https://wiki.php.net/rfc/stringable.\n\n## Setup\nJust run\n```bash\ncomposer require vantoozz/strings\n```\n\n## Transformations\n```php\n\u003c?php declare(strict_types=1);\n\nuse Vantoozz\\Strings\\Transforms\\Acronym;\nuse Vantoozz\\Strings\\Transforms\\CaseToggled;\nuse Vantoozz\\Strings\\Transforms\\Reversed;\nuse Vantoozz\\Strings\\Transforms\\SnakeCased;\n\nuse function Vantoozz\\Strings\\str;\n\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$string = str('PHP: Hypertext Preprocessor');\n\necho new Acronym($string) . PHP_EOL;\necho new CaseToggled($string) . PHP_EOL;\necho new Reversed($string) . PHP_EOL;\necho new SnakeCased($string) . PHP_EOL;\n\n```\nWill output\n```bash\nPHP\nphp: hYPERTEXT pREPROCESSOR\nrossecorperP txetrepyH :PHP\np_h_p:_hypertext_preprocessor\n```\n### Available transformations\n* Acronym\n* CamelCased\n* CaseToggled\n* KebabCased\n* LowerCased\n* PascalCased\n* Reversed\n* SentenceCased\n* SnakeCased\n* TitleCased\n* UpperCased\n\n## Joins\n```php\n\u003c?php declare(strict_types=1);\n\nuse Vantoozz\\Strings\\Joins\\EndingWith;\nuse Vantoozz\\Strings\\Joins\\Joined;\nuse Vantoozz\\Strings\\Joins\\StartingWith;\n\nuse function Vantoozz\\Strings\\str;\n\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$one = str('aabbc');\n$two = str('ccddaa');\n\necho new Joined($one, $two) . PHP_EOL;\necho new EndingWith($one, $two) . PHP_EOL;\necho new StartingWith($one, $two) . PHP_EOL;\n```\nWill output\n```bash\naabbcccddaa\naabbccddaa\nccddaabbc\n```\n\n### Available joins\n* Joined\n* StartingWith\n* EndingWith\n\n## Formats\n```php\n\u003c?php declare(strict_types=1);\n\nuse Vantoozz\\Strings\\Exceptions\\InvalidFormatException;\nuse Vantoozz\\Strings\\Formats\\Email;\n\nuse function Vantoozz\\Strings\\str;\n\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n\ntry {\n    echo new Email(str('user@example.com')) . PHP_EOL;\n} catch (InvalidFormatException $e) {\n    echo $e-\u003egetMessage() . PHP_EOL;\n}\n\ntry {\n    echo new Email(str('user%example.com')) . PHP_EOL;\n} catch (InvalidFormatException $e) {\n    echo $e-\u003egetMessage() . PHP_EOL;\n}\n```\nWill output\n```bash\nuser@example.com\nInvalid format\n```\n### Available formats\n* Email\n* Hostname\n* Ipv4\n* Ipv6\n* Mac\n* Sha1\n* Sha256\n* Url\n\n## Composition\n```php\n\u003c?php declare(strict_types=1);\n\nuse Vantoozz\\Strings\\Formats\\Email;\nuse Vantoozz\\Strings\\Joins\\EndingWith;\nuse Vantoozz\\Strings\\Transforms\\CaseToggled;\n\nuse function Vantoozz\\Strings\\str;\n\n\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$username = str('User@');\n$domain = str('@Example.Com');\n\necho new CaseToggled(new Email(new EndingWith($username, $domain))) . PHP_EOL;\n\n```\nWill output\n```bash\nuSER@eXAMPLE.cOM\n```\n\n\n## Testing\n```bash\n./vendor/bin/phpunit\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvantoozz%2Fstrings","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvantoozz%2Fstrings","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvantoozz%2Fstrings/lists"}