How To Parse A String In C# Code Example

Snippet 1

  string phrase = "The quick brown    fox     jumps over the lazy dog.";
string[] words = phrase.Split(' ');

foreach (var word in words)
{
    System.Console.WriteLine($"");
}
 

Snippet 2

  //Split using a string delimiter instead of a char
data.Split(new string[] { "xx" }, StringSplitOptions.None); 

Copyright © Code Fetcher 2020

 

 

Published

Leave a comment

Your email address will not be published. Required fields are marked *