code: public static List<String> splitFixedText(final List<ColumnMetaData> columnMetaData, final String lineToParse,
              final boolean preserveLeadingWhitespace, final boolean preserveTrailingWhitespace) {
          final List<String> splitResult = new ArrayList<>();
          int recPosition = 1;
          for (final ColumnMetaData colMetaDataObj : columnMetaData) {
              String tempValue = lineToParse.substring(recPosition - 1, recPosition + colMetaDataObj.getColLength() - 1);
              recPosition += colMetaDataObj.getColLength();
              // make sure that we preserve leading and trailing spaces as user has requested
              // This was previously issuing a trim()
              if (!preserveLeadingWhitespace) {
                  tempValue = ParserUtils.lTrim(tempValue);
              }
              if (!preserveTrailingWhitespace) {
                  tempValue = ParserUtils.rTrim(tempValue);
              }
  
              splitResult.add(tempValue);
          }
  
          return splitResult;
      }
docs: Splits up a fixed width line of text
  
  @param columnMetaData
  Collection of ColumnMetaData to parse the line
  @param lineToParse
  Line of text to be parsed against the ColumnMetaData
  @param preserveLeadingWhitespace
  Keep any leading spaces
  @param preserveTrailingWhitespace
  Keep any trailing spaces
  @return List Collection of Strings. Each element representing a column