{"id":24598447,"url":"https://github.com/technobre/powerutils.text","last_synced_at":"2025-04-30T15:48:00.017Z","repository":{"id":39968309,"uuid":"387032204","full_name":"TechNobre/PowerUtils.Text","owner":"TechNobre","description":"Helpers, extensions and utilities for manipulating strings","archived":false,"fork":false,"pushed_at":"2025-04-11T00:20:02.000Z","size":222,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-30T15:47:52.897Z","etag":null,"topics":["csharp","dotnet","string-manipulation","text-manipulation"],"latest_commit_sha":null,"homepage":"https://www.nuget.org/packages/PowerUtils.Text/","language":"C#","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/TechNobre.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-07-17T20:33:44.000Z","updated_at":"2025-04-11T00:20:05.000Z","dependencies_parsed_at":"2023-02-10T05:45:33.552Z","dependency_job_id":"ff24bb9b-c3a5-47f5-889a-3b9f3636dad8","html_url":"https://github.com/TechNobre/PowerUtils.Text","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/TechNobre%2FPowerUtils.Text","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechNobre%2FPowerUtils.Text/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechNobre%2FPowerUtils.Text/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechNobre%2FPowerUtils.Text/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TechNobre","download_url":"https://codeload.github.com/TechNobre/PowerUtils.Text/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251734301,"owners_count":21635113,"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":["csharp","dotnet","string-manipulation","text-manipulation"],"created_at":"2025-01-24T12:16:25.536Z","updated_at":"2025-04-30T15:47:59.973Z","avatar_url":"https://github.com/TechNobre.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PowerUtils.Text\n\n![Logo](https://raw.githubusercontent.com/TechNobre/PowerUtils.Text/main/assets/logo/logo_128x128.png)\n\n***Helpers, extensions and utilities for manipulating strings***\n\n![Tests](https://github.com/TechNobre/PowerUtils.Text/actions/workflows/tests.yml/badge.svg)\n[![Mutation tests](https://img.shields.io/endpoint?style=flat\u0026url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2FTechNobre%2FPowerUtils.Text%2Fmain)](https://dashboard.stryker-mutator.io/reports/github.com/TechNobre/PowerUtils.Text/main)\n\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=TechNobre_PowerUtils.Text\u0026metric=alert_status)](https://sonarcloud.io/summary/new_code?id=TechNobre_PowerUtils.Text)\n[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=TechNobre_PowerUtils.Text\u0026metric=coverage)](https://sonarcloud.io/summary/new_code?id=TechNobre_PowerUtils.Text)\n[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=TechNobre_PowerUtils.Text\u0026metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=TechNobre_PowerUtils.Text)\n[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=TechNobre_PowerUtils.Text\u0026metric=bugs)](https://sonarcloud.io/summary/new_code?id=TechNobre_PowerUtils.Text)\n\n[![NuGet](https://img.shields.io/nuget/v/PowerUtils.Text.svg)](https://www.nuget.org/packages/PowerUtils.Text)\n[![Nuget](https://img.shields.io/nuget/dt/PowerUtils.Text.svg)](https://www.nuget.org/packages/PowerUtils.Text)\n[![License: MIT](https://img.shields.io/github/license/TechNobre/PowerUtils.Text.svg)](https://github.com/TechNobre/PowerUtils.Text/blob/main/LICENSE)\n\n\n- [Support to ](#support-to-)\n- [How to use ](#how-to-use-)\n  - [Install NuGet package ](#install-nuget-package-)\n  - [TextExtensions ](#textextensions-)\n    - [string.CleanExtraSpaces(); ](#stringcleanextraspaces-)\n    - [string.CleanExtraLineBreak(); ](#stringcleanextralinebreak-)\n    - [string.CleanExtraLineBreakAndLineBreak(); ](#stringcleanextralinebreakandlinebreak-)\n    - [string.EmptyOrWhiteSpaceToNull(); ](#stringemptyorwhitespacetonull-)\n    - [string.CompressText(maxLength); ](#stringcompresstextmaxlength-)\n    - [string.Truncate(maxLength); ](#stringtruncatemaxlength-)\n    - [string.CapitalizeName(); ](#stringcapitalizename-)\n    - [string.CleanSpecialCharacters(substitute = \"\"); ](#stringcleanspecialcharacterssubstitute---)\n    - [string.UppercaseFirst(); ](#stringuppercasefirst-)\n    - [string.LowercaseFirst(); ](#stringlowercasefirst-)\n    - [string.ToSnakeCase(); ](#stringtosnakecase-)\n  - [TextExtensions ](#textextensions--1)\n    - [string.IsEmail(); ](#stringisemail-)\n    - [string.CombineURL(); ](#stringcombineurl-)\n    - [object.ToQueryString(); ](#objecttoquerystring-)\n- [Contribution ](#contribution-)\n\n\n\n## Support to \u003ca name=\"support-to\"\u003e\u003c/a\u003e\n- .NET 9.0\n- .NET 8.0\n- .NET 7.0\n- .NET 6.0\n- .NET 5.0\n- .NET 3.1\n\n\n\n## How to use \u003ca name=\"how-to-use\"\u003e\u003c/a\u003e\n\n### Install NuGet package \u003ca name=\"installation\"\u003e\u003c/a\u003e\nThis package is available through Nuget Packages: https://www.nuget.org/packages/PowerUtils.Text\n\n**Nuget**\n```bash\nInstall-Package PowerUtils.Text\n```\n\n**.NET CLI**\n```\ndotnet add package PowerUtils.Text\n```\n\n\n\n### TextExtensions \u003ca name=\"TextExtensions\"\u003e\u003c/a\u003e\n\n#### string.CleanExtraSpaces(); \u003ca name=\"string.CleanExtraSpaces\"\u003e\u003c/a\u003e\nClean extra spaces. Replace tabs to one space and double spaces to one space\n\n```csharp\n// result = \"Hello world!!!\"\nvar result = \" Hello  world!!! \".CleanExtraSpaces();\n```\n\n#### string.CleanExtraLineBreak(); \u003ca name=\"string.CleanExtraLineBreak\"\u003e\u003c/a\u003e\nClean extra line breaks. Replace double line breaks to one line break\n\n```csharp\n// result = \"Hello\\r\\nWorld!!!\"\nvar result = \"Hello\\r\\n\\r\\n\\r\\nWorld!!!\".CleanExtraLineBreak();\n```\n\n#### string.CleanExtraLineBreakAndLineBreak(); \u003ca name=\"string.CleanExtraLineBreakAndLineBreak\"\u003e\u003c/a\u003e\nClean extra spaces, override tabs to one space, double spaces to one space and double line breaks to one line break\n\n```csharp\n// result = \"Hello\\r\\nWorld!!!\"\nvar result = \"   Hello \\r\\n\\r\\n\\r\\n  World!!! \".CleanExtraLineBreakAndLineBreak();\n```\n\n#### string.EmptyOrWhiteSpaceToNull(); \u003ca name=\"string.EmptyOrWhiteSpaceToNull\"\u003e\u003c/a\u003e\nConvert a string with empty or white spaces to null\n\n```csharp\n// result = null\nvar result = \"       \".EmptyOrWhiteSpaceToNull();\n```\n\n#### string.CompressText(maxLength); \u003ca name=\"string.CompressText\"\u003e\u003c/a\u003e\nCompress text if greater the max length\n\n```csharp\n// result = \"Hell...\"\nvar result = \"Hello world!!!\".CompressText(5);\n```\n\n#### string.Truncate(maxLength); \u003ca name=\"string.Truncate\"\u003e\u003c/a\u003e\nTruncate text if greater the max length\n\n```csharp\n// result = \"Hello\"\nvar result = \"Hello world!!!\".Truncate(5);\n```\n\n#### string.CapitalizeName(); \u003ca name=\"string.CapitalizeName\"\u003e\u003c/a\u003e\nCapitalize the people amd company names\n\n```csharp\n// result = \"Nelson Nobre\"\nvar result = \"nelson nobre\".CapitalizeName();\n```\n\n#### string.CleanSpecialCharacters(substitute = \"\"); \u003ca name=\"string.CleanSpecialCharacters\"\u003e\u003c/a\u003e\nCapitalize the people amd company names\n\n```csharp\n// result1 = \"HelloWorld\"\nvar result1 = \"Hello World!!!\".CleanSpecialCharacters();\n\n// result2 = \"Hello-World\"\nvar result2 = \"Hello World\".CleanSpecialCharacters(\"-\");\n```\n\n#### string.UppercaseFirst(); \u003ca name=\"string.UppercaseFirst\"\u003e\u003c/a\u003e\nUppercase the first character\n\n```csharp\n// result = \"Hello world!!!\"\nvar result = \"hello world!!!\".UppercaseFirst();\n```\n\n#### string.LowercaseFirst(); \u003ca name=\"string.LowercaseFirst\"\u003e\u003c/a\u003e\nUppercase the first character\n\n```csharp\n// result = \"hello world!!!\"\nvar result = \"Hello world!!!\".UppercaseFirst();\n```\n\n#### string.ToSnakeCase(); \u003ca name=\"string.ToSnakeCase\"\u003e\u003c/a\u003e\nConvert a text to snake case format\n\n```csharp\n// result = \"test_snake_case\"\nvar result = \"TestSnakeCase\".ToSnakeCase();\n```\n\n\n\n### TextExtensions \u003ca name=\"TextExtensions\"\u003e\u003c/a\u003e\n\n#### string.IsEmail(); \u003ca name=\"string.IsEmail\"\u003e\u003c/a\u003e\nCheck if the input is an email\n\n```csharp\n// result = true\nvar result = \"nelson@fake.com\".IsEmail();\n```\n\n#### string.CombineURL(); \u003ca name=\"string.CombineURL\"\u003e\u003c/a\u003e\nCheck if the input is an email\n\n```csharp\n// result = http://localhost:8080/clients/photos\nvar result = \"http://localhost:8080\".CombineURL(\"clients\", \"photos\");\n```\n\n#### object.ToQueryString(); \u003ca name=\"object.ToQueryString\"\u003e\u003c/a\u003e\nConvert an object to a QueryString.\n\n```csharp\nobject parameters = new\n{\n    Name = \"Nelson\",\n    Age = 12,\n    IsValide = true\n};\n\n// result = ?Name=Nelson\u0026Age=12\u0026IsValide=True\nvar result = parameters.ToQueryString();\n```\n\n\n\n## Contribution \u003ca name=\"contribution\"\u003e\u003c/a\u003e\n\nIf you have any questions, comments, or suggestions, please open an [issue](https://github.com/TechNobre/PowerUtils.Text/issues/new/choose) or create a [pull request](https://github.com/TechNobre/PowerUtils.Text/compare)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechnobre%2Fpowerutils.text","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechnobre%2Fpowerutils.text","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechnobre%2Fpowerutils.text/lists"}