Suppose I have a string "I love Programming" and I want to get all the words seprately. Here is a simple example:-
string a = "I love Programming";
string[] words = a.Split(' ');
// We pass the value inside '' on the basis of which we want to split the words. Here I have used space
foreach (string word in words)
{
Console.WriteLine(word);
}
OR
// to get the third word use
string b = words[2];
// b will give "Programming"
0 Comment(s)