{"id":32195357,"url":"https://github.com/randomseed-io/smangler","last_synced_at":"2026-07-13T06:31:35.796Z","repository":{"id":62435372,"uuid":"200531553","full_name":"randomseed-io/smangler","owner":"randomseed-io","description":"String mangling library for Clojure","archived":false,"fork":false,"pushed_at":"2022-11-23T10:09:26.000Z","size":162,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-06-01T19:07:06.486Z","etag":null,"topics":["infixes","prefixes","string-manipulation","string-trimming","strings","substrings","suffixes"],"latest_commit_sha":null,"homepage":null,"language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/randomseed-io.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":"2019-08-04T19:08:49.000Z","updated_at":"2022-11-23T10:00:53.000Z","dependencies_parsed_at":"2023-01-22T06:02:59.220Z","dependency_job_id":null,"html_url":"https://github.com/randomseed-io/smangler","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/randomseed-io/smangler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/randomseed-io%2Fsmangler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/randomseed-io%2Fsmangler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/randomseed-io%2Fsmangler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/randomseed-io%2Fsmangler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/randomseed-io","download_url":"https://codeload.github.com/randomseed-io/smangler/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/randomseed-io%2Fsmangler/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35413537,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-13T02:00:06.543Z","response_time":119,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["infixes","prefixes","string-manipulation","string-trimming","strings","substrings","suffixes"],"created_at":"2025-10-22T02:09:17.277Z","updated_at":"2026-07-13T06:31:35.790Z","avatar_url":"https://github.com/randomseed-io.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# smangler – String Mangling Library\n\n[![Smangler on Clojars](https://img.shields.io/clojars/v/io.randomseed/smangler.svg)](https://clojars.org/io.randomseed/smangler)\n[![Smangler on cljdoc](https://cljdoc.org/badge/io.randomseed/smangler)](https://cljdoc.org/d/io.randomseed/smangler/CURRENT)\n\nAnother Clojure library for manipulating strings.\n\n* It **trims** the same or different characters from both ends of a string:\n\n```clojure\n(require '[smangler.api :as s])\n\n;; Trim the same letters from both ends.\n(s/trim-both \"madam\")\n; =\u003e \"d\"\n\n;; Trim the same letters but only if they are 'm' or 'n'.\n(s/trim-both \"mn\" \"madam\")\n; =\u003e \"ada\"\n\n;; Trim the same letters once.\n(s/trim-both-once \"madam\")\n; =\u003e \"ada\"\n\n;; Trim the same letters and generate a result of each step.\n(s/trim-both-seq \"madam\")\n; =\u003e (\"madam\" \"ada\" \"d\")\n```\n\n* It generates all **prefixes** and **suffixes** of a string:\n\n```clojure\n(require '[smangler.api :as s])\n\n;; Generate all prefixes.\n(s/all-prefixes \"madam\")\n; =\u003e (\"m\" \"ma\" \"mad\" \"mada\" \"madam\")\n\n;; Generate all prefixes with 'd' as a boundary character.\n(s/all-prefixes \\d \"madam\")\n; =\u003e (\"ma\" \"mad\" \"madam\")\n\n;; Generate all prefixes using dot, hyphen and comma as boundary characters.\n(s/all-prefixes \".,-\" \"ma-dam\")\n; =\u003e (\"ma\" \"ma-\" \"ma-dam\")\n\n;; Generate all suffixes using dot as boundary.\n(s/all-suffixes \".\" \"a.b.c\")\n; =\u003e (\"a.b.c\" \".b.c\" \"b.c\" \".c\" \"c\")\n```\n\n* It generates all possible prefixes, infixes and suffixes (**substrings**) of a string:\n\n```clojure\n(require '[smangler.api :as s])\n\n;; Generate all prefixes, suffixes and infixes.\n(s/all-subs \"abcd\")\n; =\u003e (\"a\" \"ab\" \"b\" \"abc\" \"bc\" \"c\")\n\n;; Generate all prefixes, suffixes and infixes using colon, dot and star\n;; as boundary characters.\n(api/all-subs \":.* \" \"use:*123*\")\n; =\u003e (\"use\"       \"use:\"     \":\"     \"use:*\" \":*\"\n      \"*\"         \"use:*123\" \":*123\" \"*123\"  \"123\"\n      \"use:*123*\" \":*123*\"   \"*123*\" \"123*\"  \"*\")\n```\n\nRecommended way is to use functions defined in `smangler.api` namespace. They coerce\nlast arguments into strings and predicate arguments into functions.\n\nUse of `smangler.core` may be helpful in special cases, where littile performance\ngain is very important. Functions from this namespace are very strict about input\ndata types and  may return values of different types than their equivalents in API.\n\n## Installation\n\nTo use smangler in your project, add the following to dependencies section of\n`project.clj` or `build.boot`:\n\n```clojure\n[io.randomseed/smangler \"1.0.4\"]\n```\n\nFor `deps.edn` add the following as an element of a map under `:deps` or\n`:extra-deps` key:\n\n```clojure\nio.randomseed/smangler {:mvn/version \"1.0.4\"}\n```\n\nYou can also download JAR from [Clojars](https://clojars.org/io.randomseed/smangler).\n\n## Documentation\n\nFull documentation including usage examples is available at:\n\n* https://randomseed.io/software/smangler/\n\n## License\n\nCopyright © 2019-2022 Paweł Wilk\n\nSmangler is copyrighted software owned by Paweł Wilk (pw@gnu.org). You may\nredistribute and/or modify this software as long as you comply with the terms of\nthe [GNU Lesser General Public License][LICENSE] (version 3).\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n## Development\n\n[![CircleCI](https://circleci.com/gh/randomseed-io/smangler.svg?style=svg)](https://circleci.com/gh/randomseed-io/smangler)\n\n### Building docs\n\n```bash\nmake docs\n```\n\n### Building JAR\n\n```bash\nmake jar\n```\n\n### Rebuilding POM\n\n```bash\nmake pom\n```\n\n### Signing POM\n\n```bash\nmake sig\n```\n\n### Deploying to Clojars\n\n```bash\nmake deploy\n```\n\n### Interactive development\n\n```bash\nbin/repl\n```\n\nStarts REPL and nREPL server (port number is stored in `.nrepl-port`).\n\n[LICENSE]:    https://github.com/randomseed-io/smangler/blob/master/LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frandomseed-io%2Fsmangler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frandomseed-io%2Fsmangler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frandomseed-io%2Fsmangler/lists"}