/// <summary> /// Initializes a new instance of a FixedLengthParserOptions. /// </summary> public FixedLengthOptions() { FillCharacter = ' '; alignment = FixedAlignment.LeftAligned; HasRecordSeparator = true; truncationPolicy = OverflowTruncationPolicy.TruncateLeading; }
private string GetTruncatedValue(string value, Window window) { OverflowTruncationPolicy policy = window.TruncationPolicy ?? Metadata.ExecutionContext.Options.TruncationPolicy; if (policy == OverflowTruncationPolicy.TruncateLeading) { int start = value.Length - window.Width; // take characters on the end return(value.Substring(start, window.Width)); } return(value.Substring(0, window.Width)); }
private string getTruncatedValue(string value, Window window) { OverflowTruncationPolicy policy = window.TruncationPolicy ?? options.TruncationPolicy; if (policy == OverflowTruncationPolicy.TruncateLeading) { int start = value.Length - window.Width; // take characters on the end return(value.Substring(start, window.Width)); } else { return(value.Substring(0, window.Width)); } }
/// <summary> /// Initializes a new instance of a FixedLengthParserOptions. /// </summary> public FixedLengthOptions() { FillCharacter = ' '; RecordSeparator = Environment.NewLine; truncationPolicy = OverflowTruncationPolicy.TruncateLeading; }