Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string[] lines = doc.Split('n');
- for (int i = 0; i < lines.Length; i+= 1)
- lines[i] = lines[i].Trim();
- string path = "yourfile.txt";
- string[] lines = File.ReadAllLines(path);
- string content = File.ReadAllText(path);
- string[] lines = content.Split(
- Environment.NewLine.ToCharArray(),
- StringSplitOptions.RemoveEmptyEntries);
- string line = String.Empty;
- StreamReader reader = new StreamReader(path);
- while ((line = reader.ReadLine()) != null)
- {
- // do stuff
- }
- StreamReader reader = new StreamReader(file);
- string _Line = reader.ReadToEnd();
- string IntMediateLine = string.Empty;
- IntMediateLine = _Line.Replace("entersign", "");
- string[] ArrayLineSpliter = IntMediateLine.Split('any specail chaarater');
- private static string[] Split(string s, string delim)
- {
- if (s == null) throw new NullReferenceException();
- // Declarations
- var strings = new ArrayList();
- var start = 0;
- // Tokenize
- if (delim != null && delim != "")
- {
- int i;
- while ((i = s.IndexOf(delim, start)) != -1)
- {
- strings.Add(s.Substring(start, i - start));
- start = i + delim.Length;
- }
- }
- // Append left over
- strings.Add(s.Substring(start));
- return (string[]) strings.ToArray(typeof(string));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement