{"id":16777071,"url":"https://github.com/mpclarkson/stringy","last_synced_at":"2025-10-03T22:58:22.821Z","repository":{"id":57020501,"uuid":"45813109","full_name":"mpclarkson/stringy","owner":"mpclarkson","description":"Stringy - Object Oriented Manipulation of Strings in PHP!","archived":false,"fork":false,"pushed_at":"2019-04-08T01:06:53.000Z","size":12,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T18:11:36.609Z","etag":null,"topics":["php","strings","swift"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mpclarkson.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":"2015-11-09T03:37:43.000Z","updated_at":"2020-06-27T05:48:39.000Z","dependencies_parsed_at":"2022-08-23T13:50:37.354Z","dependency_job_id":null,"html_url":"https://github.com/mpclarkson/stringy","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpclarkson%2Fstringy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpclarkson%2Fstringy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpclarkson%2Fstringy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpclarkson%2Fstringy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mpclarkson","download_url":"https://codeload.github.com/mpclarkson/stringy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248290070,"owners_count":21078923,"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":["php","strings","swift"],"created_at":"2024-10-13T07:23:23.164Z","updated_at":"2025-10-03T22:58:17.783Z","avatar_url":"https://github.com/mpclarkson.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Stringy - Object Oriented Manipulation of Strings in PHP!\n=========================================================\n\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/mpclarkson/stringy/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/mpclarkson/stringy/?branch=master)\n[![Build Status](https://travis-ci.org/mpclarkson/stringy.svg?branch=master)](https://travis-ci.org/mpclarkson/stringy)\n\nOverview\n--------\n\nAre you stick to death of PHP's inconsistencies in terms on manipulating strings? Well, look no further!\n\nRather than constantly having to write obtuse code like this to check if a string contains a substring:\n\n```  php\n  strpos($mystring, $substring) !== false ? true : false;\n\n```\n\nYou can now do this (and many other things), sensibly!\n\n``` php\n  $string = new String($myString);\n\n  $bool = $string-\u003econtains($substring);\n\n```\n\nYay! :)\n\nUsage\n------------\n\nAfter applying any methods, the underlying text/string can be accessed as follows:\n\n```php\n$stringy = new Stringy(\"mystring\");\n$stringy-\u003eappend(\"is fun\", \" \");\n\necho $stringy-\u003estring();\n//\"mystring is fun\";\n\n```\n\nMethods\n------------\n\nMethod | Parameters | Returns\n--- | --- | ---\nstring | nil | string\ntruncate | $chars = 50, $appendWith = \"...\" | $this\nlength | nil | int\ncontains | $substring | bool\nstartsWith | $substring | bool\nendsWith | $substring | bool\nappend | $string | $this\nreverse | nil | $this\nuppercase | nil | $this\nuppercaseFirst | nil | $this\nlowercase | nil | $this\nlowercaseFirst | nil | $this\ntitleCase | nil | $this\nsentenceCase | nil | $this\ntoArray | $delimiter = null | array\napply | callback | $this\n\nCheckout the tests for examples of each method.\n\nRequirements\n------------\n\n  * PHP 5.4+\n\n\nComposer\n---------\n\nUse [Composer](https://getcomposer.org) by adding the following lines in your `composer.json`:\n\n```json\n\n    \"require\": {\n        \"mpclarkson/stringy\": \"dev-master\"\n    },\n\n```\n\nTodos\n-----\n\n  * More methods\n  * Contributions welcome\n\n\nCredits\n-----\n\nThis has been inspired by the beautify string manipulation in Apple's Swift language.\n\nThanks goes to [Paper Planes Digital Marketing in Brisbane](https://flypaperplanes.co).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpclarkson%2Fstringy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmpclarkson%2Fstringy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpclarkson%2Fstringy/lists"}