public String[] split(final CharSequence line) {
			columns.clear();
			column.reset();

			boolean quoted = false;
			boolean escaped = false;
			boolean full = false;

			int quoteIndex = 0;

			for (int i = 0, n = line.length(); i < n && !full; ++i) {
				final int previous = i > 0 ? line.charAt(i - 1) : -1;
				final char current = line.charAt(i);
				final int next = i + 1 < line.length() ? line.charAt(i + 1) : -1;

				if (current == quote.value) {
					if (quoted) {
						if (!escaped && quote.value == next) {
							escaped = true;
						} else {
							if (escaped) {
								column.append(quote.value);
								escaped = false;
							} else {
								if (next != -1 && separator.value != next) {
									throw new IllegalArgumentException("""
										Only separator character, '%s', allowed \
										after quote, but found '%c':
										%s
										""".formatted(
											separator.value,
										next,
											toErrorDesc(line, i + 1)
										)
									);
								}

								add(column);
								full = columns.isFull();
								quoted = false;
							}
						}
					} else {
						if (previous != -1 && separator.value != previous) {
							throw new IllegalArgumentException("""
								Only separator character, '%s', allowed before \
								quote, but found '%c':
								%s
								""".formatted(
									separator.value,
								previous,
									toErrorDesc(line, Math.max(i - 1, 0))
								)
							);
						}

						quoted = true;
						quoteIndex = i;
					}
				} else if (current == separator.value) {
					if (quoted) {
						column.append(current);
					} else if (separator.value == previous || previous == -1) {
						add(column);
						full = columns.isFull();
					}
				} else {
					// Read till the next token separator.
					int j = i;
					char c;
					while (j < line.length() && !isTokenSeparator(c = line.charAt(j))) {
						column.append(c);
						++j;
					}
					if (j != i - 1) {
						i = j - 1;
					}

					if (!quoted) {
						add(column);
						full = columns.isFull();
					}
				}
			}

			if (quoted) {
				throw new IllegalArgumentException("""
					Unbalanced quote character.
					%s
					""".formatted(toErrorDesc(line, quoteIndex))
				);
			}
			if (line.isEmpty() ||
				separator.value == line.charAt(line.length() - 1))
			{
				add(column);
			}

			return columns.toArray();
		}
Splitting the given CSV {@code line} into its columns.

@implNote
The split {@code String[]} array will never contain {@code null} values.
Empty columns will be returned as empty strings.

@param line the CSV line to split
@return the split CSV columns
@throws NullPointerException if the CSV {@code line} is {@code null}
jenetics.ext/src/main/java/io/jenetics/ext/util/CsvSupport.java