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 AhujaPosted Apr 28, 2010, 8:51 AM
");
Dipa AhujaPosted Apr 28, 2010, 2:56 PM
GustavoPosted Apr 28, 2010, 11:44 AM
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 AhujaPosted Apr 28, 2010, 10:50 AM
Jaish MathewsPosted Apr 28, 2010, 9:23 AM
Use foreach loop like below
string[] Fields = { "File_ID", "File_ID_Sub", "Update_ID" };
foreach (string s in Fields)
{
Console.WriteLine(s);
}