Esempio n. 1
0
        CarriageFlairs ParseCarriageFlairs(string flair)
        {
            var bits = flair.Split(':');

            var result = new CarriageFlairs
            {
                PreflairWhitespace = bits[0],
                Flairs             = new List <CarriageFlair>()
            };

            for (var i = 1; i < bits.Length - 1; i += 2)
            {
                result.Flairs.Add(new CarriageFlair(bits[i])
                {
                    TrailingWhitespace = bits[i + 1]
                });
            }

            return(result);
        }
Esempio n. 2
0
 string FormatCarriageFlairs(CarriageFlairs carriageFlairs)
 {
     return($"{carriageFlairs.PreflairWhitespace}{string.Join("", carriageFlairs.Flairs.Select(FormatCarriageFlair))}");
 }