Skip to content

Commit

Permalink
First Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Blundell authored and Sam Blundell committed Oct 30, 2019
1 parent 20d422b commit daf23d1
Show file tree
Hide file tree
Showing 245 changed files with 12,268 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .vs/ProjectSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"CurrentProjectSetting": null
}
Binary file added .vs/StringHelper/DesignTimeBuild/.dtbcache
Binary file not shown.
Binary file added .vs/StringHelper/v16/.suo
Binary file not shown.
Empty file.
Binary file added .vs/StringHelper/v16/Server/sqlite3/storage.ide
Binary file not shown.
Binary file not shown.
Binary file added .vs/StringHelper/v16/TestStore/0/testlog.manifest
Binary file not shown.
8 changes: 8 additions & 0 deletions .vs/VSWorkspaceState.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"ExpandedNodes": [
"",
"\\src"
],
"SelectedNode": "\\src",
"PreviewInSolutionExplorer": false
}
Binary file added .vs/slnx.sqlite
Binary file not shown.
36 changes: 36 additions & 0 deletions StringHelper.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29403.142
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StringHelper", "src\StringHelper.csproj", "{40EDC905-00E3-4F60-8D31-5971DE8E7B00}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{7394643A-4552-4F27-9101-61113EDB95F8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StringHelper.UnitTest", "tests\StringHelper.UnitTest.csproj", "{0D642F42-D732-4322-B9B4-5CA3B6E1D66A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{40EDC905-00E3-4F60-8D31-5971DE8E7B00}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{40EDC905-00E3-4F60-8D31-5971DE8E7B00}.Debug|Any CPU.Build.0 = Debug|Any CPU
{40EDC905-00E3-4F60-8D31-5971DE8E7B00}.Release|Any CPU.ActiveCfg = Release|Any CPU
{40EDC905-00E3-4F60-8D31-5971DE8E7B00}.Release|Any CPU.Build.0 = Release|Any CPU
{0D642F42-D732-4322-B9B4-5CA3B6E1D66A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0D642F42-D732-4322-B9B4-5CA3B6E1D66A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0D642F42-D732-4322-B9B4-5CA3B6E1D66A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0D642F42-D732-4322-B9B4-5CA3B6E1D66A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{0D642F42-D732-4322-B9B4-5CA3B6E1D66A} = {7394643A-4552-4F27-9101-61113EDB95F8}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {283D24F2-DE31-4996-B630-972195204EB4}
EndGlobalSection
EndGlobal
Binary file added src/.vs/StringHelper/DesignTimeBuild/.dtbcache
Binary file not shown.
Empty file.
Binary file not shown.
21 changes: 21 additions & 0 deletions src/RepeatExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using System.Linq;

namespace System
{
/// <summary>
/// repeat string extensions class
/// </summary>
public static class RepeatExtensions
{
/// <summary>
/// Repeats a given string for a given number of repetitions
/// </summary>
/// <param name="input">the string you wish to repeat</param>
/// <param name="repetitions">the number of repetitions</param>
/// <returns>the final repeated string</returns>
public static string Repeat(this string input, int repetitions)
{
return string.Concat(Enumerable.Repeat(input, repetitions));
}
}
}
15 changes: 15 additions & 0 deletions src/StringHelper.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>Sam Blundell</Authors>
<Company>Sam Blundell Software</Company>
<Copyright>Copyright (c) 2019 Sam Blundell</Copyright>
<RepositoryUrl>https://github.com/SamB1990/StringHelper</RepositoryUrl>
<RepositoryType>github</RepositoryType>
<NeutralLanguage>en-GB</NeutralLanguage>
<Description>.Net Helper Extension for strings</Description>
</PropertyGroup>

</Project>
43 changes: 43 additions & 0 deletions src/WrapExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
using System.Collections.Generic;

namespace System
{
/// <summary>
/// wrap string extensions methods class
/// </summary>
public static class WrapExtensions
{
/// <summary>
/// wraps a given string at a given length into an ienumerable of chopped strings split on the last white space
/// </summary>
/// <param name="input">the string that you wish to chop</param>
/// <param name="maxLength">the max length that you wish to chop at</param>
/// <returns>an ienumerable of chopped strings</returns>
public static IEnumerable<string> Wrap(this string input, int maxLength)
{
do
{
if (input.Length < maxLength)
{
if(!string.IsNullOrEmpty(input))
yield return input;
break;
}
var trimmedString = input.Substring(0, maxLength);

if (trimmedString.Length != 0)
{
var requiredLength = Math.Min(trimmedString.Length, trimmedString.LastIndexOf(" ", StringComparison.Ordinal));
if(requiredLength > 0)
trimmedString = trimmedString.Substring(0, requiredLength);
}

input = input.Replace(trimmedString, "").Trim();

if(!string.IsNullOrEmpty(trimmedString))
yield return trimmedString;

} while (true);
}
}
}
Binary file added src/bin/Debug/StringHelper.1.0.0.nupkg
Binary file not shown.
47 changes: 47 additions & 0 deletions src/bin/Debug/netstandard2.0/StringHelper.deps.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"runtimeTarget": {
"name": ".NETStandard,Version=v2.0/",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETStandard,Version=v2.0": {},
".NETStandard,Version=v2.0/": {
"StringHelper/1.0.0": {
"dependencies": {
"NETStandard.Library": "2.0.3"
},
"runtime": {
"StringHelper.dll": {}
}
},
"Microsoft.NETCore.Platforms/1.1.0": {},
"NETStandard.Library/2.0.3": {
"dependencies": {
"Microsoft.NETCore.Platforms": "1.1.0"
}
}
}
},
"libraries": {
"StringHelper/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
},
"Microsoft.NETCore.Platforms/1.1.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==",
"path": "microsoft.netcore.platforms/1.1.0",
"hashPath": "microsoft.netcore.platforms.1.1.0.nupkg.sha512"
},
"NETStandard.Library/2.0.3": {
"type": "package",
"serviceable": true,
"sha512": "sha512-st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==",
"path": "netstandard.library/2.0.3",
"hashPath": "netstandard.library.2.0.3.nupkg.sha512"
}
}
}
Binary file added src/bin/Debug/netstandard2.0/StringHelper.dll
Binary file not shown.
Binary file added src/bin/Debug/netstandard2.0/StringHelper.pdb
Binary file not shown.
Binary file added src/bin/Release/StringHelper.1.0.0.nupkg
Binary file not shown.
47 changes: 47 additions & 0 deletions src/bin/Release/netstandard2.0/StringHelper.deps.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"runtimeTarget": {
"name": ".NETStandard,Version=v2.0/",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETStandard,Version=v2.0": {},
".NETStandard,Version=v2.0/": {
"StringHelper/1.0.0": {
"dependencies": {
"NETStandard.Library": "2.0.3"
},
"runtime": {
"StringHelper.dll": {}
}
},
"Microsoft.NETCore.Platforms/1.1.0": {},
"NETStandard.Library/2.0.3": {
"dependencies": {
"Microsoft.NETCore.Platforms": "1.1.0"
}
}
}
},
"libraries": {
"StringHelper/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
},
"Microsoft.NETCore.Platforms/1.1.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==",
"path": "microsoft.netcore.platforms/1.1.0",
"hashPath": "microsoft.netcore.platforms.1.1.0.nupkg.sha512"
},
"NETStandard.Library/2.0.3": {
"type": "package",
"serviceable": true,
"sha512": "sha512-st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==",
"path": "netstandard.library/2.0.3",
"hashPath": "netstandard.library.2.0.3.nupkg.sha512"
}
}
}
Binary file not shown.
Binary file added src/bin/Release/netstandard2.0/StringHelper.pdb
Binary file not shown.
19 changes: 19 additions & 0 deletions src/obj/Debug/StringHelper.1.0.0.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>StringHelper</id>
<version>1.0.0</version>
<authors>Sam Blundell</authors>
<owners>Sam Blundell</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>.Net Helper Extension for strings</description>
<copyright>Copyright (c) 2019 Sam Blundell</copyright>
<repository type="github" url="https://github.com/SamB1990/StringHelper" />
<dependencies>
<group targetFramework=".NETStandard2.0" />
</dependencies>
</metadata>
<files>
<file src="C:\Users\sam\source\repos\StringHelper\src\bin\Debug\netstandard2.0\StringHelper.dll" target="lib\netstandard2.0\StringHelper.dll" />
</files>
</package>
26 changes: 26 additions & 0 deletions src/obj/Debug/netstandard2.0/StringHelper.AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

using System;
using System.Reflection;

[assembly: System.Reflection.AssemblyCompanyAttribute("Sam Blundell Software")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright (c) 2019 Sam Blundell")]
[assembly: System.Reflection.AssemblyDescriptionAttribute(".Net Helper Extension for strings")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
[assembly: System.Reflection.AssemblyProductAttribute("StringHelper")]
[assembly: System.Reflection.AssemblyTitleAttribute("StringHelper")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
[assembly: System.Resources.NeutralResourcesLanguageAttribute("en-GB")]

// Generated by the MSBuild WriteCodeFragment class.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
48b2a4aa86cca3b7227d877f87c9c5aa6d966cab
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
C:\Users\sam\Source\Repos\SamB1990\MSSQL_CLR_Extractor\Src\StringHelper\bin\Debug\netstandard2.0\StringHelper.deps.json
C:\Users\sam\Source\Repos\SamB1990\MSSQL_CLR_Extractor\Src\StringHelper\bin\Debug\netstandard2.0\StringHelper.dll
C:\Users\sam\Source\Repos\SamB1990\MSSQL_CLR_Extractor\Src\StringHelper\bin\Debug\netstandard2.0\StringHelper.pdb
C:\Users\sam\Source\Repos\SamB1990\MSSQL_CLR_Extractor\Src\StringHelper\obj\Debug\netstandard2.0\StringHelper.AssemblyInfoInputs.cache
C:\Users\sam\Source\Repos\SamB1990\MSSQL_CLR_Extractor\Src\StringHelper\obj\Debug\netstandard2.0\StringHelper.AssemblyInfo.cs
C:\Users\sam\Source\Repos\SamB1990\MSSQL_CLR_Extractor\Src\StringHelper\obj\Debug\netstandard2.0\StringHelper.dll
C:\Users\sam\Source\Repos\SamB1990\MSSQL_CLR_Extractor\Src\StringHelper\obj\Debug\netstandard2.0\StringHelper.pdb
C:\Users\sam\Source\Repos\SamB1990\MSSQL_CLR_Extractor\Src\StringHelper\obj\Debug\netstandard2.0\StringHelper.csprojAssemblyReference.cache
C:\Users\sam\source\repos\StringHelper\src\bin\Debug\netstandard2.0\StringHelper.deps.json
C:\Users\sam\source\repos\StringHelper\src\bin\Debug\netstandard2.0\StringHelper.dll
C:\Users\sam\source\repos\StringHelper\src\bin\Debug\netstandard2.0\StringHelper.pdb
C:\Users\sam\source\repos\StringHelper\src\obj\Debug\netstandard2.0\StringHelper.csprojAssemblyReference.cache
C:\Users\sam\source\repos\StringHelper\src\obj\Debug\netstandard2.0\StringHelper.AssemblyInfoInputs.cache
C:\Users\sam\source\repos\StringHelper\src\obj\Debug\netstandard2.0\StringHelper.AssemblyInfo.cs
C:\Users\sam\source\repos\StringHelper\src\obj\Debug\netstandard2.0\StringHelper.dll
C:\Users\sam\source\repos\StringHelper\src\obj\Debug\netstandard2.0\StringHelper.pdb
Binary file not shown.
Binary file added src/obj/Debug/netstandard2.0/StringHelper.dll
Binary file not shown.
Binary file added src/obj/Debug/netstandard2.0/StringHelper.pdb
Binary file not shown.
19 changes: 19 additions & 0 deletions src/obj/Release/StringHelper.1.0.0.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>StringHelper</id>
<version>1.0.0</version>
<authors>Sam Blundell</authors>
<owners>Sam Blundell</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>.Net Helper Extension for strings</description>
<copyright>Copyright (c) 2019 Sam Blundell</copyright>
<repository type="github" url="https://github.com/SamB1990/StringHelper" />
<dependencies>
<group targetFramework=".NETStandard2.0" />
</dependencies>
</metadata>
<files>
<file src="C:\Users\sam\source\repos\StringHelper\src\bin\Release\netstandard2.0\StringHelper.dll" target="lib\netstandard2.0\StringHelper.dll" />
</files>
</package>
26 changes: 26 additions & 0 deletions src/obj/Release/netstandard2.0/StringHelper.AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

using System;
using System.Reflection;

[assembly: System.Reflection.AssemblyCompanyAttribute("Sam Blundell Software")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright (c) 2019 Sam Blundell")]
[assembly: System.Reflection.AssemblyDescriptionAttribute(".Net Helper Extension for strings")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
[assembly: System.Reflection.AssemblyProductAttribute("StringHelper")]
[assembly: System.Reflection.AssemblyTitleAttribute("StringHelper")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
[assembly: System.Resources.NeutralResourcesLanguageAttribute("en-GB")]

// Generated by the MSBuild WriteCodeFragment class.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a8bbb5bc52829170798beb19f5e15dc01002b849
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
C:\Users\sam\source\repos\StringHelper\src\bin\Release\netstandard2.0\StringHelper.deps.json
C:\Users\sam\source\repos\StringHelper\src\bin\Release\netstandard2.0\StringHelper.dll
C:\Users\sam\source\repos\StringHelper\src\bin\Release\netstandard2.0\StringHelper.pdb
C:\Users\sam\source\repos\StringHelper\src\obj\Release\netstandard2.0\StringHelper.csprojAssemblyReference.cache
C:\Users\sam\source\repos\StringHelper\src\obj\Release\netstandard2.0\StringHelper.AssemblyInfoInputs.cache
C:\Users\sam\source\repos\StringHelper\src\obj\Release\netstandard2.0\StringHelper.AssemblyInfo.cs
C:\Users\sam\source\repos\StringHelper\src\obj\Release\netstandard2.0\StringHelper.dll
C:\Users\sam\source\repos\StringHelper\src\obj\Release\netstandard2.0\StringHelper.pdb
Binary file not shown.
Binary file not shown.
Binary file added src/obj/Release/netstandard2.0/StringHelper.pdb
Binary file not shown.
5 changes: 5 additions & 0 deletions src/obj/StringHelper.csproj.nuget.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"version": 1,
"dgSpecHash": "hyAPnCUt+hs0nzzrEME1XJLAsJMK09+eqFD957A7WT3lawsOqFuRVCQf7xD1z6DgQbl6EZH34mOFgR/bkNeS6Q==",
"success": true
}
Loading

0 comments on commit daf23d1

Please sign in to comment.