how to split line exist in a file using (particular)str ing(ex., and ,or,etc., )
need of c# code for the above problem statement
mine is only working only for seperators
thanks
aphoorva
User Profile
Collapse
-
how to split line exist in a file using a particular string
-
splitting lines in a file
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
...Code:static void Main(string[] args) { int i = 1; foreach (string line1 in File.ReadAllLines(@"g:/employee.txt")) { string[] srs = line1.Split('and','.');Last edited by Frinavale; Oct 25 '11, 05:34 PM. Reason: Added code tags, formatted code so that it is more legible and added the ending '}' for the main method.
No activity results to display
Show More