@param int    $lineNumber
@param array  $rowContent
@param string $sepPrefix

@return string
548143
private function drawLine(int $lineNumber, array $rowContent, string $sepPrefix = 'sep_'): string
    {
        $line = '';
        foreach ($rowContent as $columnName => $cellContent) {
            $lineContent = '';

            // If the line contains some text...
            if (isset($cellContent[$lineNumber])) {
                // Use it
                $lineContent = $cellContent[$lineNumber];
            }

            $alignSpaces = 0;

            // Count characters and draw spaces if needed
            if (iconv_strlen($lineContent) < $this->columnsWidths[$columnName]) {
                $alignSpaces = $this->columnsWidths[$columnName] - iconv_strlen($lineContent);
            }

            // Draw the line
            $line
                // Vertical Separator
                .= $this->options[$sepPrefix . 'v']
                // + left padding
                . $this->drawSpaces($this->options['cells_padding'][3]);

            if (false === isset($this->options['columns'][$columnName]['align'])) {
                $this->options['columns'][$columnName]['align'] = $this->options['default_cell_align'];
            }

            switch ($this->options['columns'][$columnName]['align']) {
                case 'left':
                    $line .=
                        // + content
                        trim($lineContent)
                        // + right spaces
                        . $this->drawSpaces($alignSpaces);
                    break;

                case 'right':
                    $line .=
                        // + right spaces
                        $this->drawSpaces($alignSpaces)
                        // + content
                        . trim($lineContent);
                    break;
            }

            // + right padding
            $line .= $this->drawSpaces($this->options['cells_padding'][1]);
        }

        return $line . $this->options[$sepPrefix . 'v'] . PHP_EOL;
    }
968517
func (l *lexer) lineNumber() int {
	return 1 + strings.Count(string(l.input[:l.lastPos]), "\n")
}
1027743
public String getPlainTextContext(int fromPos, int toPos, String contents) {
    String text = contents.replace('\n', ' ').replace('\r', ' ').replace('\t', ' ');
    // calculate context region:
    int startContent = fromPos - contextSize;
    String prefix = "...";
    String postfix = "...";
    String markerPrefix = "   ";
    if (startContent < 0) {
      prefix = "";
      markerPrefix = "";
      startContent = 0;
    }
    int endContent = toPos + contextSize;
    if (endContent > text.length()) {
      postfix = "";
      endContent = text.length();
    }
    StringBuilder marker = getMarker(fromPos, toPos, text.length() + prefix.length());
    // now build context string plus marker:
    return prefix + text.substring(startContent, endContent) + postfix + '\n' + markerPrefix + marker.substring(startContent, endContent);
  }
896715
public function setHeaderRowNumber($rowNumber)
    {
        $this->headerRowNumber = $rowNumber;
        $this->columnHeaders = $this->worksheet[$rowNumber];
    }
610189
function thOpenEnd($rowName, $colName, $content) {
    $this->cellContents[$rowName][$colName] = $content;
    $this->openEndCells[$rowName][$colName] = true;
    $this->cellTagNames[$rowName][$colName] = 'th';
    return $this;
  }
723073
protected final int getLineNumber(final String lineNumber) {
        if (StringUtils.isNotBlank(lineNumber)) {
            try {
                return Integer.parseInt(lineNumber);
            }
            catch (NumberFormatException exception) {
                // ignore and return 0
            }
        }
        return 0;
    }
1293190
public static function explode(string $separator, string $content, ?callable $itemFunction = null): array
    {
        if ($separator === "\n") {
            $content = str_replace("\r", '', $content);
        }
        $items = explode($separator, $content);
        if (is_callable($itemFunction)) {
            foreach ($items as $index => $item) {
                $items[$index] = $itemFunction($item);
            }
        }
        return $items;
    }
188074
public void mapLineNumber(Location start, int line_number) {
        if (mLineNumberTable == null) {
            addAttribute(new LineNumberTableAttr(getConstantPool()));
        }
        mLineNumberTable.addEntry(start, line_number);
    }
1252306
function (element, number) {
			if (element.tagName !== 'PRE' || !element.classList.contains(PLUGIN_NAME)) {
				return;
			}

			var lineNumberRows = element.querySelector('.line-numbers-rows');
			var lineNumberStart = parseInt(element.getAttribute('data-start'), 10) || 1;
			var lineNumberEnd = lineNumberStart + (lineNumberRows.children.length - 1);

			if (number < lineNumberStart) {
				number = lineNumberStart;
			}
			if (number > lineNumberEnd) {
				number = lineNumberEnd;
			}

			var lineIndex = number - lineNumberStart;

			return lineNumberRows.children[lineIndex];
		}
668161
public static function wrap(string $text, int $length, string $separator = "\n"): string
    {
        if ($text === '' || self::length($text) === $length) {
            return $text;
        }
        $endedWithLinebreak = substr($text, -1) === "\n";
        $text = str_replace("\r", '', $text);
        $text = str_replace("\n", '', $text);
        $text = explode(' ', $text);

        $result = [];
        $lineNo = 0;
        foreach ($text as $word) {
            if (!isset($result[$lineNo])) {
                $result[$lineNo] = '';
            }
            $lastLineNo = count($result) - 1;

            if ((self::length($result[$lastLineNo]) + self::length($word)) >= $length) {
                $lineNo++;
                if (!isset($result[$lineNo])) {
                    $result[$lineNo] = '';
                }
                $lastLineNo = count($result) - 1;
            }

            $result[$lastLineNo] .= $result[$lastLineNo] !== '' ? ' ' : '';
            $result[$lastLineNo] .= $word;
        }

        $text = implode($separator, $result);
        if ($endedWithLinebreak) {
            $text .= "\n";
        }
        return $text;
    }
1013273
public function assertTextInTableRow($text, $rowText)
    {
        $row = $this->getTableRow($this->getSession()->getPage(), $rowText);
        if (strpos($row->getText(), $text) === false) {
            throw new \Exception(sprintf('Found a row containing "%s", but it did not contain the text "%s".', $rowText, $text));
        }
    }
147365
public static void goToLine(IEditorPart editorPart, int lineNumber) {
        if (!(editorPart instanceof ITextEditor) || lineNumber < DEFAULT_LINE_IN_EDITOR) {
            return;
        }
        ITextEditor editor = (ITextEditor) editorPart;
        IDocument document = editor.getDocumentProvider().getDocument(editor.getEditorInput());
        if (document != null) {
            IRegion lineInfo = null;
            try {
                // line count internaly starts with 0, and not with 1 like in
                // GUI
                lineInfo = document.getLineInformation(lineNumber - 1);
            } catch (BadLocationException e) {
                // ignored because line number may not really exist in document,
                // we guess this...
            }
            if (lineInfo != null) {
                editor.selectAndReveal(lineInfo.getOffset(), lineInfo.getLength());
            }
        }
    }
1305831
protected function _setLineNumber($lineNumber)
    {
        if ($lineNumber !== null) {
            try {
                $lineNumber = $this->_normalizeInt($lineNumber);
            } catch (RootException $e) {
                throw $this->_createInvalidArgumentException($this->__('Invalid line number'), null, $e, $lineNumber);
            }

            if ($lineNumber < 1) {
                throw $this->_createInvalidArgumentException($this->__('Line number must be positive'), null, null, $lineNumber);
            }
        }

        $this->lineNumber = $lineNumber;
    }
899882
protected function buildRowSeparator(array $columnWidths, string $separator = '-'): string
	{
		$columns = count($columnWidths);

		return str_repeat($separator, array_sum($columnWidths) + (($columns * 4) - ($columns - 1))) . PHP_EOL;
	}
470507
protected function addTodoMarkerToFile($fileDescriptor, $todo, $lineNumber)
    {
        $fileDescriptor->getMarkers()->add(
            array(
                'type'    => 'TODO',
                'message' => $todo->getDescription(),
                'line'    => $lineNumber,
            )
        );
    }
90132
function createContentLeftNumColRow(index) {
    var row = this.dataSourceObj.rows[index];
    var rootObj = row.value;
    var objAry = this.selectRows;
    var re = objCompare(rootObj, objAry);
    var htmlStr;
    var heightStr = '';

    if (!this.options.needResetHeight) {
        heightStr = 'height:' + (this.options.rowHeight + 1) + 'px;';
    }
    if (re) {
        htmlStr = '<div style="width:' + this.numWidth + 'px;' + heightStr + '" class="u-grid-content-num  u-grid-content-sel-row">' + (index + 1) + '</div>';
    } else {
        htmlStr = '<div style="width:' + this.numWidth + 'px;' + heightStr + '" class="u-grid-content-num">' + (index + 1) + '</div>';
    }
    return htmlStr;
}
461448
public static function dttm2br($var,$separador="/"){
			if(preg_match('/([0-9]{4})\-([0-9]{2})\-([012][0-9]|3[01])[ ]([0-9]{2}):([0-9]{2}):([0-9]{2})/', $var, $array)){
				$dt = self::checkDtbr($array[3], $array[2], $array[1],$separador);
				if($dt && ($array[4] != '00' || $array[5] != '00'))
					$dt .= '  '.$array[4].':'.$array[5];
				return $dt;
			}
		}