Skip to content

Commit 5eb0e0b

Browse files
committed
Fix crash for leading and trailing
1 parent fd43121 commit 5eb0e0b

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

src/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ Please check the GitHub repository getting more info.
1414

1515
## Release notes
1616

17+
### [2023-07-10] 0.0.5
18+
- Fix crash in case of leading and trailing spaces
19+
1720
### [2023-07-10] 0.0.4
1821
- Added capitalCase on the project name
1922

src/StringExtensions.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,13 @@ public static class StringExtensions
77
public static string ToCapitalCase(this string str)
88
{
99
// Implement capital case logic here
10-
if (str == null)
11-
{
12-
throw new ArgumentNullException(nameof(str));
13-
}
14-
if (str.Length == 0)
10+
if (string.IsNullOrWhiteSpace(str))
1511
{
1612
return str;
1713
}
1814

1915
// Split the string into words separated by a space character or period
20-
var splitString = str.Split(' ', '.');
16+
var splitString = str.Trim().Split(' ', '.');
2117
var sb = new StringBuilder();
2218
foreach (var word in splitString)
2319
{

src/genocs.cli.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<Nullable>enable</Nullable>
88
<PackAsTool>true</PackAsTool>
99
<ToolCommandName>genocs</ToolCommandName>
10-
<PackageVersion>0.0.4</PackageVersion>
10+
<PackageVersion>0.0.5</PackageVersion>
1111
<PackageOutputPath>./nupkg</PackageOutputPath>
1212
<PackageId>Genocs.CLI</PackageId>
1313
<Title>Genocs CLI Tool</Title>
@@ -19,7 +19,7 @@
1919
<PackageReadmeFile>README.md</PackageReadmeFile>
2020
<PackageLicenseFile>LICENSE</PackageLicenseFile>
2121
<PackageIcon>icon.png</PackageIcon>
22-
<VersionPrefix>0.0.4</VersionPrefix>
22+
<VersionPrefix>0.0.5</VersionPrefix>
2323
</PropertyGroup>
2424

2525
<ItemGroup>

0 commit comments

Comments
 (0)