Skip to content
This repository was archived by the owner on Aug 30, 2025. It is now read-only.

Commit dfffa0e

Browse files
authored
Merge pull request #5 from TechNobre/dev
Dev
2 parents d9a750e + 5b05740 commit dfffa0e

9 files changed

Lines changed: 613 additions & 153 deletions

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build and deploy package
1+
name: CI/CD
22

33
on:
44
push:

.gitignore

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ mono_crash.*
2323
[Rr]eleases/
2424
x64/
2525
x86/
26+
[Ww][Ii][Nn]32/
2627
[Aa][Rr][Mm]/
2728
[Aa][Rr][Mm]64/
2829
bld/
@@ -64,6 +65,9 @@ artifacts/
6465
# Tye
6566
.tye/
6667

68+
# ASP.NET Scaffolding
69+
ScaffoldingReadMe.txt
70+
6771
# StyleCop
6872
StyleCopReport.xml
6973

@@ -141,7 +145,9 @@ _TeamCity*
141145
!.axoCover/settings.json
142146

143147
# Coverlet is a free, cross platform Code Coverage Tool
144-
coverage*[.json, .xml, .info]
148+
coverage*.json
149+
coverage*.xml
150+
coverage*.info
145151

146152
# Visual Studio code coverage results
147153
*.coverage
@@ -305,9 +311,6 @@ paket-files/
305311
# FAKE - F# Make
306312
.fake/
307313

308-
# Ionide - VsCode extension for F# Support
309-
.ionide/
310-
311314
# CodeRush personal settings
312315
.cr/personal
313316

@@ -358,6 +361,9 @@ MigrationBackup/
358361
# Ionide (cross platform F# VS Code tools) working folder
359362
.ionide/
360363

364+
# Fody - auto-generated XML schema
365+
FodyWeavers.xsd
366+
361367
##
362368
## Visual studio for Mac
363369
##

README.md

Lines changed: 68 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
# PowerUtils.Text
22
Helpers, extensions and utilities for manipulating
33

4-
| Package | Version | Downloads |
5-
| --- | --- | --- |
6-
| `PowerUtils.Text` | [![NuGet](https://img.shields.io/nuget/v/PowerUtils.Text.svg)](https://www.nuget.org/packages/PowerUtils.Text) | [![Nuget](https://img.shields.io/nuget/dt/PowerUtils.Text.svg)](https://www.nuget.org/packages/PowerUtils.Text) |
4+
![CI](https://github.com/TechNobre/PowerUtils.Text/actions/workflows/main.yml/badge.svg)
5+
[![NuGet](https://img.shields.io/nuget/v/PowerUtils.Text.svg)](https://www.nuget.org/packages/PowerUtils.Text)
6+
[![Nuget](https://img.shields.io/nuget/dt/PowerUtils.Text.svg)](https://www.nuget.org/packages/PowerUtils.Text)
7+
8+
79

810
## Support to
911
- .NET 2.0 or more
@@ -12,6 +14,21 @@ Helpers, extensions and utilities for manipulating
1214

1315

1416

17+
## Features
18+
19+
- [Extensions](#Extensions)
20+
- [CleanExtraSpaces](#string.CleanExtraSpaces)
21+
- [CleanExtraLineBreak](#string.CleanExtraLineBreak)
22+
- [CleanExtraLineBreakAndLineBreak](#string.CleanExtraLineBreakAndLineBreak)
23+
- [EmptyOrWhiteSpace](#string.EmptyOrWhiteSpace)
24+
- [CompressText](#string.CompressText)
25+
- [Truncate](#string.Truncate)
26+
- [UppercaseFirst](#string.UppercaseFirst)
27+
- [CapitalizeName](#string.CapitalizeName)
28+
- [CleanSpecialCharacters](#string.CleanSpecialCharacters)
29+
30+
31+
1532
## Documentation
1633

1734
### How to use
@@ -29,64 +46,83 @@ Install-Package PowerUtils.Text
2946
dotnet add package PowerUtils.Text
3047
```
3148

32-
### Extensions
33-
34-
35-
#### string.CleanExtraSpaces();
49+
### Extensions <a name="Extensions"></a>
3650

51+
#### string.CleanExtraSpaces(); <a name="string.CleanExtraSpaces"></a>
3752
Clean extra spaces. Replace tabs to one space and double spaces to one space
3853

3954
```csharp
4055
// result = "Hello world!!!"
4156
var result = " Hello world!!! ".CleanExtraSpaces();
4257
```
4358

44-
45-
#### string.CleanExtraLineBreak();
46-
59+
#### string.CleanExtraLineBreak(); <a name="string.CleanExtraLineBreak"></a>
4760
Clean extra line breaks. Replace double line breaks to one line break
4861

4962
```csharp
5063
// result = "Hello\r\nWorld!!!"
5164
var result = "Hello\r\n\r\n\r\nWorld!!!".CleanExtraLineBreak();
5265
```
5366

54-
#### string.CleanExtraLineBreakAndLineBreak();
55-
67+
#### string.CleanExtraLineBreakAndLineBreak(); <a name="string.CleanExtraLineBreakAndLineBreak"></a>
5668
Clean extra spaces, override tabs to one space, double spaces to one space and double line breaks to one line break
5769

5870
```csharp
5971
// result = "Hello\r\nWorld!!!"
6072
var result = " Hello \r\n\r\n\r\n World!!! ".CleanExtraLineBreakAndLineBreak();
6173
```
6274

63-
#### string.EmptyOrWhiteSpace();
64-
75+
#### string.EmptyOrWhiteSpace(); <a name="string.EmptyOrWhiteSpace"></a>
6576
Convert a string with empty or white spaces to null
6677

6778
```csharp
6879
// result = null
6980
var result = " ".EmptyOrWhiteSpace();
7081
```
7182

72-
#### string.CompressText(maxLength);
73-
83+
#### string.CompressText(maxLength); <a name="string.CompressText"></a>
7484
Compress text if greater the max length
7585

7686
```csharp
77-
// result = "Hell"
87+
// result = "Hell..."
7888
var result = "Hello world!!!".CompressText(5);
7989
```
8090

81-
#### string.Truncate(maxLength);
82-
91+
#### string.Truncate(maxLength); <a name="string.Truncate"></a>
8392
Truncate text if greater the max length
8493

8594
```csharp
8695
// result = "Hello"
8796
var result = "Hello world!!!".Truncate(5);
8897
```
8998

99+
#### string.UppercaseFirst(); <a name="string.UppercaseFirst"></a>
100+
Uppercase the first character
101+
102+
```csharp
103+
// result = "Hello world!!!"
104+
var result = "hello world!!!".UppercaseFirst();
105+
```
106+
107+
#### string.CapitalizeName(); <a name="string.CapitalizeName"></a>
108+
Capitalize the people amd company names
109+
110+
```csharp
111+
// result = "Nelson Nobre"
112+
var result = "nelson nobre".CapitalizeName();
113+
```
114+
115+
#### string.CleanSpecialCharacters(substitute = ""); <a name="string.CleanSpecialCharacters"></a>
116+
Capitalize the people amd company names
117+
118+
```csharp
119+
// result1 = "HelloWorld"
120+
var result1 = "Hello World!!!".CleanSpecialCharacters();
121+
122+
// result2 = "Hello-World"
123+
var result2 = "Hello World".CleanSpecialCharacters("-");
124+
```
125+
90126

91127

92128
## Contribution
@@ -97,4 +133,16 @@ var result = "Hello world!!!".Truncate(5);
97133

98134
## LICENSE
99135

100-
[MIT](https://github.com/TechNobre/PowerUtils.Text/blob/main/LICENSE)
136+
[MIT](https://github.com/TechNobre/PowerUtils.Text/blob/main/LICENSE)
137+
138+
139+
140+
## Release Notes
141+
142+
143+
### v1.1.0 - 2021/07/18
144+
145+
#### New features
146+
- Added extension **string.UppercaseFirst()**. To uppercase the first character;
147+
- Added extension **string.CapitalizeName()**. To capitalize the people and company names;
148+
- Added extension **string.CleanSpecialCharacters()**. To replace all special characters in a string for other character;

src/1.PowerUtils.Text.csproj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<PackageId>PowerUtils.Text</PackageId>
1212
<title>PowerUtils.Text</title>
1313
<Product>PowerUtils.Text</Product>
14-
<Version>1.0.0</Version>
14+
<Version>1.1.0</Version>
1515

1616
<Authors>Nelson Nobre</Authors>
1717
<Company>TechNobre</Company>
@@ -21,7 +21,7 @@
2121
<Copyright>Copyright © 2018 by TechNobre</Copyright>
2222

2323
<Description>Helpers, extensions and utilities for manipulating</Description>
24-
<PackageReleaseNotes>Helpers, extensions and utilities for manipulating</PackageReleaseNotes>
24+
<PackageReleaseNotes>Added extension string.UppercaseFirst(); Added extension string.CapitalizeName(); Added extension string.CleanSpecialCharacters();</PackageReleaseNotes>
2525
<Summary>Helpers, extensions and utilities for manipulating</Summary>
2626
<PackageTags>PowerUtils;Utils;Helpers;Text;Formatting;Extension;Extensions;String</PackageTags>
2727
<RepositoryUrl>https://github.com/TechNobre/PowerUtils.Text</RepositoryUrl>
@@ -71,7 +71,8 @@
7171
<DefineConstants>NET;NET5</DefineConstants>
7272
</PropertyGroup>
7373

74-
<ItemGroup>
74+
75+
<ItemGroup>
7576
<None Include="..\LICENSE" Pack="true" PackagePath=""/>
7677
</ItemGroup>
7778

src/PowerUtilsExtensions.cs

Lines changed: 0 additions & 125 deletions
This file was deleted.

0 commit comments

Comments
 (0)