{"id":20548077,"url":"https://github.com/lusingander/sasa","last_synced_at":"2026-06-10T07:31:15.503Z","repository":{"id":195447134,"uuid":"692923142","full_name":"lusingander/sasa","owner":"lusingander","description":"String utilities for Go 🎋","archived":false,"fork":false,"pushed_at":"2024-12-26T00:36:21.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-13T13:04:22.164Z","etag":null,"topics":["go","string"],"latest_commit_sha":null,"homepage":"","language":"Go","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/lusingander.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-09-18T01:19:51.000Z","updated_at":"2024-12-26T00:27:17.000Z","dependencies_parsed_at":"2024-11-16T02:12:12.650Z","dependency_job_id":"31c7f1e6-88bb-44f2-be30-f92e7766d862","html_url":"https://github.com/lusingander/sasa","commit_stats":null,"previous_names":["lusingander/sasa"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/lusingander/sasa","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lusingander%2Fsasa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lusingander%2Fsasa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lusingander%2Fsasa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lusingander%2Fsasa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lusingander","download_url":"https://codeload.github.com/lusingander/sasa/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lusingander%2Fsasa/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34142637,"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-06-10T02:00:07.152Z","response_time":89,"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":["go","string"],"created_at":"2024-11-16T02:11:56.771Z","updated_at":"2026-06-10T07:31:15.487Z","avatar_url":"https://github.com/lusingander.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Go Reference](https://pkg.go.dev/badge/github.com/lusingander/sasa.svg)](https://pkg.go.dev/github.com/lusingander/sasa)\n\n# sasa\n\nString utilities for Go\n\n## Usage\n\n### Requirements\n\nGo 1.20+\n\n### TrimMargin\n\n[trimMargin](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/trim-margin.html) in Kotlin, or [stripMargin](https://www.scala-lang.org/api/current/scala/collection/StringOps.html#stripMargin:String) in Scala\n\n```go\nfunc main() {\n\ts := sasa.TrimMargin(`\n\t|foo\n\t| bar\n\t|  baz\n\t`)\n\tfmt.Println(s)\n\t// =\u003e\n\t//foo\n\t// bar\n\t//  baz\n\n\tt := sasa.TrimMargin(`foo\n\t# bar\n\t#  baz`, sasa.MarginPrefix(\"#\"))\n\tfmt.Println(t)\n\t// =\u003e\n\t//foo\n\t// bar\n\t//  baz\n}\n```\n\n### TrimIndent\n\n[trimIndent](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/trim-indent.html) in Kotlin\n\n```go\nfunc main() {\n\ts := sasa.TrimIndent(`\n\tfoo\n\t bar\n\t  baz\n\t`)\n\tfmt.Println(s)\n\t// =\u003e\n\t//foo\n\t// bar\n\t//  baz\n}\n```\n\n### ReplacePrefix / ReplaceSuffix\n\n```go\nfunc main() {\n\ts := ReplacePrefix(\"aaaaabbbaaa\", \"aa\", \"x\")\n\tfmt.Println(s)\n\t// =\u003e\n\t//xxabbbaaa\n\t\n\ts := ReplaceSuffix(\"aaabbbaaaaa\", \"aa\", \"x\")\n\tfmt.Println(s)\n\t// =\u003e\n\t//aaabbbaxx\n}\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flusingander%2Fsasa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flusingander%2Fsasa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flusingander%2Fsasa/lists"}