hi,
am trying to split lines in a file in such a way
where ever and or dot(.) comes in a file the line should get splitted
my code is working only for .(dot)not for (and)
code is as shown below
with regards
aphoorva
am trying to split lines in a file in such a way
where ever and or dot(.) comes in a file the line should get splitted
my code is working only for .(dot)not for (and)
code is as shown below
Code:
static void Main(string[] args)
{
int i = 1;
foreach (string line1 in File.ReadAllLines(@"g:/employee.txt"))
{
string[] srs = line1.Split('and','.');
foreach (string dot in srs)
{
Console.WriteLine("{0}:{1}",i,dot);
i++;
}
}
Console.ReadLine();
}
with regards
aphoorva
Comment