Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Regex startsWith = new Regex("^<catalog", RegexOptions.Singleline);
- List<String> combinedLines = new List<string>();
- string lastline = ""; //for keepign track of the last line in case we need to merge the two
- foreach (var line in File.ReadLines(filepath))
- {
- Match match = startsWith.Match(line.Trim());
- if (!match.Success)
- {
- found_matching_lines = true;
- combinedLines.Add(lastline.Trim() + line.Trim());
- }
- lastline = line;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement