コード例 #1
0
 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);
 }
コード例 #2
0
 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);
     }
 }
コード例 #3
0
        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());
        }