public void SetSettingsFrom(StringSplitOption stringSplitOption) { this.AddToAll = stringSplitOption.HasFlag(StringSplitOption.AddToAll); this.AutoTrim = stringSplitOption.HasFlag(StringSplitOption.TrimPerElement); this.PrintSpecialCharacter = stringSplitOption.HasFlag(StringSplitOption.PrintSpecialCharacter); this.AllowSpecialChar = stringSplitOption.HasFlag(StringSplitOption.AllowSpecialChar); }
public static string Tokenize(this string input, StringQuoteOption quoteoption, StringSplitOption tokenOptions, params string[] tokens) { using (var tokenizer = new StringTokenizer(input, tokens)) { tokenizer.StringQuoteOption = quoteoption; tokenizer.SetSettingsFrom(tokenOptions); return(tokenizer.Tokenize().TokenText); } }
public static string[] SplitEx(this string input, string[] splitters, int count = 0, StringSplitOption options = StringSplitOption.None) { StringSplitter splitter = new StringSplitter(input) { Splitters = splitters, Count = count, SplitOptions = options }; return(splitter.Split()); }