示例#1
0
        public static string ApplyFormatToLines(this string lines, LineFormat format)
        {
            List <string> lineList = lines.GetLines();
            StringBuilder sb       = new StringBuilder();
            int           i        = 0;

            foreach (string s in lineList)
            {
                sb.AppendLine(format.FormatLine(s, i));
                i++;
            }
            return(sb.ToString());
        }
示例#2
0
        public static List <string> ApplyFormatToLines(this IEnumerable <string> lines, LineFormat format)
        {
            List <string> res = new List <string>();
            int           i   = 0;

            foreach (string s in lines)
            {
                res.Add(format.FormatLine(s, i));
                i++;
            }
            return(res);
        }