# Class HelperParser OptimaJet.Workflow.Core.Helpers.HelperParser Provides utilities for parsing delimiter-separated text, matching wildcard masks, and formatting camel-cased text. Namespace: [OptimaJet.Workflow.Core.Helpers](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Helpers/) ```csharp public static class HelperParser ``` ## Methods `public static List SplitWithTrim(string text, string[] delimiter)` Splits `text` using any of the specified delimiters and trims leading and trailing whitespace from each segment that was not initially empty. ### Parameters | Name | Type | Description | | --- | --- | --- | | `text` | `String` | The text to split. | | `delimiter` | `String[]` | The delimiters that separate segments in `text`. | ### Returns | Type | Description | | --- | --- | | `List` | The trimmed segments. An empty list is returned when `text` is [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null). | `public static List SplitWithTrim(string text, string delimiter)` Splits `text` using the specified delimiter and trims leading and trailing whitespace from each segment that was not initially empty. ### Parameters | Name | Type | Description | | --- | --- | --- | | `text` | `String` | The text to split. | | `delimiter` | `String` | The delimiter that separates segments in `text`. | ### Returns | Type | Description | | --- | --- | | `List` | The trimmed segments. An empty list is returned when `text` is [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null). | `public static List<(string, string)> Parse2xNList(string text, string[] outerDelimiters, string[] innerDelimiters)` Parses `text` into pairs by splitting it into outer segments and selecting the first and last values obtained by splitting each segment. ### Parameters | Name | Type | Description | | --- | --- | --- | | `text` | `String` | The text containing the pairs to parse. | | `outerDelimiters` | `String[]` | The delimiters that separate pairs. | | `innerDelimiters` | `String[]` | The delimiters that separate values within each pair. | ### Returns | Type | Description | | --- | --- | | `List` | The parsed pairs in input order. An empty list is returned when `text` is [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null). | ### Exceptions | Type | Description | | --- | --- | | `InvalidOperationException` | Thrown when an outer segment does not contain a value after it is split using `innerDelimiters`. | `public static List<(string, string)> Parse2xNList(string text, string outerDelimiter, string innerDelimiter)` Parses `text` into pairs by splitting it into outer segments and selecting the first and last values obtained by splitting each segment. ### Parameters | Name | Type | Description | | --- | --- | --- | | `text` | `String` | The text containing the pairs to parse. | | `outerDelimiter` | `String` | The delimiter that separates pairs. | | `innerDelimiter` | `String` | The delimiter that separates values within each pair. | ### Returns | Type | Description | | --- | --- | | `List` | The parsed pairs in input order. An empty list is returned when `text` is [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null). | ### Exceptions | Type | Description | | --- | --- | | `InvalidOperationException` | Thrown when an outer segment does not contain a value after it is split using `innerDelimiter`. | `public static List<(List, List)> Parse2xNxNList(string text, string outerDelimiter, string innerDelimiter, string leftDelimiter, string rightDelimiter)` Parses `text` into pairs of value groups. For each outer segment, the first and last portions obtained with `innerDelimiter` are split independently. ### Parameters | Name | Type | Description | | --- | --- | --- | | `text` | `String` | The text containing the value groups to parse. | | `outerDelimiter` | `String` | The delimiter that separates pairs of value groups. | | `innerDelimiter` | `String` | The delimiter that separates the left and right portions of each pair. | | `leftDelimiter` | `String` | The delimiter that separates values in the left portion of each pair. | | `rightDelimiter` | `String` | The delimiter that separates values in the right portion of each pair. | ### Returns | Type | Description | | --- | --- | | `List` | The parsed pairs in input order, with the left values first and the right values second. An empty list is returned when `text` is [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null). | ### Exceptions | Type | Description | | --- | --- | | `InvalidOperationException` | Thrown when an outer segment does not contain a portion after it is split using `innerDelimiter`. | `public static string Join(string separator, IEnumerable values)` Joins a sequence of values, placing `separator` between consecutive values. ### Parameters | Name | Type | Description | | --- | --- | --- | | `separator` | `String` | The text to place between consecutive values. | | `values` | `IEnumerable` | The values to join. | ### Returns | Type | Description | | --- | --- | | `String` | The joined text, or [string.Empty](https://learn.microsoft.com/dotnet/api/system.string.empty) when `values` is [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) or contains no elements. | `public static bool CheckMask(string Source, string maskFiles)` Determines whether `Source` matches `maskFiles` using case-sensitive wildcard matching. ### Parameters | Name | Type | Description | | --- | --- | --- | | `Source` | `String` | The text to match. | | `maskFiles` | `String` | The wildcard mask, where an asterisk matches zero or more characters and a question mark matches exactly one character. | ### Returns | Type | Description | | --- | --- | | `Boolean` | [true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool) if the entire text matches the mask; otherwise, [false](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool). | `public static List SplitCamelCasing(string source)` Splits camel-cased text into component segments by recognizing Unicode letter casing. ### Parameters | Name | Type | Description | | --- | --- | --- | | `source` | `String` | The camel-cased text to split. | ### Returns | Type | Description | | --- | --- | | `List` | The nonempty segments in their original order and casing. | ### Exceptions | Type | Description | | --- | --- | | `ArgumentNullException` | Thrown when `source` is [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null). | `public static string CamelCasingToPhrase(string source, bool firstBig = true)` Converts the segments returned by [HelperParser.SplitCamelCasing(string)](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Helpers/HelperParser/) into a space-separated phrase. ### Parameters | Name | Type | Description | | --- | --- | --- | | `source` | `String` | The camel-cased text to convert. | | `firstBig` | `Boolean` | [true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool) to title-case segments that match the first segment and lowercase all other segments; [false](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool) to lowercase all segments. | ### Returns | Type | Description | | --- | --- | | `String` | The space-separated phrase. | ### Exceptions | Type | Description | | --- | --- | | `ArgumentNullException` | Thrown when `source` is [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null). | [Previous HelperEnum](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Helpers/HelperEnum/) [Next HelperRegex](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Helpers/HelperRegex/)