Azavea.NijPredictivePolicing.Common.Data.FixedWidthField.GetFieldData C# (CSharp) Method

GetFieldData() public method

Gets the raw data for this field from a row and updates the current position. Does not do any parsing. Throws errors if Strict is false.
public GetFieldData ( string row, int &currentPos ) : string
row string The row to read from
currentPos int The current position in the row
return string
        public string GetFieldData(string row, ref int currentPos)
        {
            try
            {
                int myStart = 0;
                int myEnd = 0;
                GetFieldRange(row, currentPos, out myStart, out myEnd);
                currentPos = myEnd;

                return row.Substring(myStart, myEnd - myStart);
            }
            catch (Exception ex)
            {
                if (Strict)
                    throw ex;
                else
                    return DefaultValue.ToString();
            }
        }