using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Dakota.Models.Segmente { internal abstract class Segment : IRowable { //public List Datenelemente { get; set; } public abstract string GetHead(); public abstract List GetBody(); public string GetRows() { Dateneinheit lastzero = null; var body = GetBody(); var bodyRev = body.ToList(); bodyRev.Reverse(); foreach (var item in bodyRev) { if (item.HasValue()) break; body.Remove(item); } return GetHead() + DakotaConfig.Trennzeichen + string.Join(DakotaConfig.Trennzeichen, body.Select(x => x.GetValue())) + DakotaConfig.Segmentendezeichen + DakotaConfig.NewLine; } } }