Class StringExtensionMethods
Handy string extensions for parsing text
Inheritance
Inherited Members
Namespace:AzureFunctionsForSharePoint.Common
Assembly:AzureFunctionsForSharePoint.Common.dll
Syntax
public static class StringExtensionMethods
Methods
| Improve this Doc View SourceGetInnerText(String, String, String)
Returns the text between the first case sensitive instances of a given preamble and postscript or an empty string.
Declaration
public static string GetInnerText(this string input, string preamble, string postscript)
Parameters
Type | Name | Description |
---|---|---|
System.String | input | The string to parse |
System.String | preamble | The beginning string to match |
System.String | postscript | The ending string to match |
Returns
Type | Description |
---|---|
System.String | The string between the preamble and postscript or nothing |
GetInnerText(String, String, String, Boolean)
Returns the text between the first case insensitive instances of a given preamble and postscript or an empty string.
Declaration
public static string GetInnerText(this string input, string preamble, string postscript, bool ignoreCase)
Parameters
Type | Name | Description |
---|---|---|
System.String | input | The string to parse |
System.String | preamble | The beginning string to match |
System.String | postscript | The ending string to match |
System.Boolean | ignoreCase | Ignore the case of the preamble and postscript if true |
Returns
Type | Description |
---|---|
System.String | The string between the preamble and postscript or nothing |
GetInnerTextList(String, String, String, Boolean)
Returns a list of strings from a string between the instances of given preamble and postscript pairs or an empty list.
Declaration
public static List<string> GetInnerTextList(this string input, string preamble, string postscript, bool ignoreCase)
Parameters
Type | Name | Description |
---|---|---|
System.String | input | The string to parse |
System.String | preamble | The beginning string to match |
System.String | postscript | The ending string to match |
System.Boolean | ignoreCase | Ignore the case of the preamble and postscript if true |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<System.String> | A list of strings |