C#: finding instances of a string within a string

前端 未结 5 1463
心在旅途
心在旅途 2021-01-28 01:28

Suppose I had the string \"1 AND 2 AND 3 OR 4\", and want to create an array of strings that contains all substrings \"AND\" or \"OR\", in order, found within the string.

<
5条回答
  •  自闭症患者
    2021-01-28 01:57

    Your probably looking for a tokeniser or Lexer, have a look at the following article:

    C# Regular Expression Recipes—A Better Tokenizer

提交回复
热议问题