Skip to content

Commit d6d1ac0

Browse files
committed
Major changes to the project structure
0 parents  commit d6d1ac0

File tree

540 files changed

+16064
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

540 files changed

+16064
-0
lines changed

.idea/.idea.StringExtension/.idea/.gitignore

+13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/.idea.StringExtension/.idea/dbnavigator.xml

+414
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/.idea.StringExtension/.idea/discord.xml

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/.idea.StringExtension/.idea/encodings.xml

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/.idea.StringExtension/.idea/indexLayout.xml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Benchmarks/Benchmark.cs

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
using Benchmark;
2+
using BenchmarkDotNet.Attributes;
3+
using BenchmarkDotNet.Configs;
4+
using BenchmarkDotNet.Running;
5+
using StringExtension;
6+
7+
BenchmarkRunner.Run<StringExtensionBenchmark>(
8+
ManualConfig.Create(DefaultConfig.Instance.WithOptions(ConfigOptions.DisableOptimizationsValidator)));
9+
10+
11+
namespace Benchmark {
12+
[MemoryDiagnoser(false)]
13+
public class StringExtensionBenchmark {
14+
private readonly string input = "hello world!";
15+
private readonly char[] charactersToRemove = {'l', 'o'};
16+
private readonly string oldValue = "world";
17+
private readonly string newValue = "everyone";
18+
19+
private readonly string substring = "l";
20+
21+
private readonly string phoneNumber = "555-555-5555";
22+
private readonly string email = "[email protected]";
23+
24+
[Benchmark]
25+
public string RemoveCharacters() {
26+
return input.RemoveCharacters(charactersToRemove);
27+
}
28+
29+
[Benchmark]
30+
public bool IsValidEmail() {
31+
return email.IsValidEmail();
32+
}
33+
34+
[Benchmark]
35+
public bool IsValidPhoneNumber() {
36+
string phoneNumber = "555-555-5555";
37+
return phoneNumber.IsValidPhoneNumber();
38+
}
39+
40+
[Benchmark]
41+
public int CountSubstring() {
42+
return input.CountSubstring(substring);
43+
}
44+
45+
[Benchmark]
46+
public string ReverseWords() {
47+
return input.ReverseWords();
48+
}
49+
50+
[Benchmark]
51+
public bool IsPalindrome() {
52+
string palindrome = "racecar";
53+
return palindrome.IsPalindrome();
54+
}
55+
56+
[Benchmark]
57+
public int CountLetters() {
58+
return input.CountLetters();
59+
}
60+
61+
[Benchmark]
62+
public string RemoveDuplicateCharacters() {
63+
return input.RemoveDuplicateCharacters();
64+
}
65+
66+
[Benchmark]
67+
public string ConvertToCamelCase() {
68+
string text = "hello_world";
69+
return text.ToCamelCase();
70+
}
71+
}
72+
}

Benchmarks/Benchmarks.csproj

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net7.0</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
<RootNamespace>StringExtensionBenchmark</RootNamespace>
9+
</PropertyGroup>
10+
11+
<ItemGroup>
12+
<PackageReference Include="BenchmarkDotNet" Version="0.13.7" />
13+
</ItemGroup>
14+
15+
<ItemGroup>
16+
<ProjectReference Include="..\StringExtension\StringExtension.csproj" />
17+
</ItemGroup>
18+
19+
</Project>
Binary file not shown.

0 commit comments

Comments
 (0)