Hello:
I have a string[] and need to extract the fields. Can someone tell me how?
string[] Fields = { "File_ID, File_ID_Sub, Update_ID" };
fpor example what do I do if I need to get the 2nd field? How can I put it in a for loop to get all of them? How can I get the count of fields?
Loading

Dipa AhujaRank #1,168 · 1.5K reputationPosted Apr 28, 2010, 4:51 AM EDT
");
Jaish MathewsRank #225 · 11K reputationPosted Apr 28, 2010, 5:23 AM EDT
Use foreach loop like below
string[] Fields = { "File_ID", "File_ID_Sub", "Update_ID" };
foreach (string s in Fields)
{
Console.WriteLine(s);
}
Dipa AhujaRank #1,168 · 1.5K reputationPosted Apr 28, 2010, 6:50 AM EDT
GustavoRank #1,990 · 732 reputationPosted Apr 28, 2010, 7:44 AM EDT
1) I was using the 'Count' instead of 'Length'.
2) I had: {"File_ID, File_ID_Sub, Update_ID"} instead of: { "File_ID" , "File_ID_Sub" , "Update_ID" }; I did not qoute each of the fields... LOL
Dipa AhujaRank #1,168 · 1.5K reputationPosted Apr 28, 2010, 10:56 AM EDT