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
public static class HelperParserMethods
public static List<string> 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
textStringThe text to split.
delimiterString[]The delimiters that separate segments in
text.Returns
Type
Description
List<String>The trimmed segments. An empty list is returned when
text is null.public static List<string> 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
textStringThe text to split.
delimiterStringThe delimiter that separates segments in
text.Returns
Type
Description
List<String>The trimmed segments. An empty list is returned when
text is 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
textStringThe text containing the pairs to parse.
outerDelimitersString[]The delimiters that separate pairs.
innerDelimitersString[]The delimiters that separate values within each pair.
Returns
Type
Description
List<String, String>The parsed pairs in input order. An empty list is returned when
text is null.Exceptions
Type
Description
InvalidOperationExceptionThrown 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
textStringThe text containing the pairs to parse.
outerDelimiterStringThe delimiter that separates pairs.
innerDelimiterStringThe delimiter that separates values within each pair.
Returns
Type
Description
List<String, String>The parsed pairs in input order. An empty list is returned when
text is null.Exceptions
Type
Description
InvalidOperationExceptionThrown when an outer segment does not contain a value after it is split using
innerDelimiter.public static List<(List<string>, List<string>)> 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
textStringThe text containing the value groups to parse.
outerDelimiterStringThe delimiter that separates pairs of value groups.
innerDelimiterStringThe delimiter that separates the left and right portions of each pair.
leftDelimiterStringThe delimiter that separates values in the left portion of each pair.
rightDelimiterStringThe delimiter that separates values in the right portion of each pair.
Returns
Type
Description
List<String, String>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.Exceptions
Type
Description
InvalidOperationExceptionThrown when an outer segment does not contain a portion after it is split using
innerDelimiter.public static string Join(string separator, IEnumerable<string> values) #Joins a sequence of values, placing
separator between consecutive values.Parameters
Name
Type
Description
separatorStringThe text to place between consecutive values.
valuesIEnumerable<String>The values to join.
Returns
Type
Description
Stringpublic static bool CheckMask(string Source, string maskFiles) #Determines whether
Source matches maskFiles using case-sensitive wildcard matching.public static List<string> SplitCamelCasing(string source) #Splits camel-cased text into component segments by recognizing Unicode letter casing.
Parameters
Name
Type
Description
sourceStringThe camel-cased text to split.
Returns
Type
Description
List<String>The nonempty segments in their original order and casing.
Exceptions
Type
Description
ArgumentNullExceptionThrown when
source is null.public static string CamelCasingToPhrase(string source, bool firstBig = true) #Converts the segments returned by HelperParser.SplitCamelCasing(string) into a space-separated phrase.
Parameters
Name
Type
Description
sourceStringThe camel-cased text to convert.
Returns
Type
Description
StringThe space-separated phrase.
Exceptions
Type
Description
ArgumentNullExceptionThrown when
source is null.