From 06c6057876e15bcfd892e79ea3e75873a14dbd80 Mon Sep 17 00:00:00 2001 From: Josh Creek Date: Wed, 25 Aug 2021 23:49:20 +0100 Subject: [PATCH] feat(*): Move readme to root --- Creek.HelpfulExtensions/README.md | 22 ---------------------- README.md | 22 +++++++++++++++++++++- 2 files changed, 21 insertions(+), 23 deletions(-) delete mode 100644 Creek.HelpfulExtensions/README.md diff --git a/Creek.HelpfulExtensions/README.md b/Creek.HelpfulExtensions/README.md deleted file mode 100644 index 8c1f2bc..0000000 --- a/Creek.HelpfulExtensions/README.md +++ /dev/null @@ -1,22 +0,0 @@ -# Creek.HelpfulExtensions - A package containing helpful extensions to either save time or cognitive load. - -## String Extensions - -### SubstringBetween - -This method allows you to return a substring from the first occurrence of the start string to the end string. Normally with `Substring` you have to put the start string and the length from there, but with this you can more naturally select between two strings, with the option to use either the first or last match for the end string. - -For example, this code will result in the string `"fishman"`. - -```csharp -string s = "bigfishmandogcatdoghat"; -s = s.SubstringBetween("fish", "dog"); -``` - -Whereas, this will result in the string `"fishmandogcat"` as the boolean passed in confirms you wish to use the last match of the end string. - -```csharp -string s = "bigfishmandogcatdoghat"; -s = s.SubstringBetween("fish", "dog", true); -``` diff --git a/README.md b/README.md index 3e015a9..8c1f2bc 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,22 @@ # Creek.HelpfulExtensions -A package containing helpful extensions to either save time or cognitive load. + A package containing helpful extensions to either save time or cognitive load. + +## String Extensions + +### SubstringBetween + +This method allows you to return a substring from the first occurrence of the start string to the end string. Normally with `Substring` you have to put the start string and the length from there, but with this you can more naturally select between two strings, with the option to use either the first or last match for the end string. + +For example, this code will result in the string `"fishman"`. + +```csharp +string s = "bigfishmandogcatdoghat"; +s = s.SubstringBetween("fish", "dog"); +``` + +Whereas, this will result in the string `"fishmandogcat"` as the boolean passed in confirms you wish to use the last match of the end string. + +```csharp +string s = "bigfishmandogcatdoghat"; +s = s.SubstringBetween("fish", "dog", true); +```