firstLines method

String firstLines(
  1. int limit
)

Returns the first limit lines of this string.

Implementation

String firstLines(int limit) {
  if (isEmpty || limit <= 0) return '';
  final List<String> lines = split(newLine);
  return lines.take(limit).join(newLine);
}