WordPress at a glance
function is not described

Text_Diff::trimNewlines() public WP 1.0

Removes trailing newlines from a line of text. This is meant to be used with array_walk().

{} It's a method of the class: Text_Diff{}

No Hooks.

Return

Null. Nothing.

Usage

$result = Text_Diff::trimNewlines( $line, $key );
$line(string) (required) (passed by reference — &)
The line to trim.
$key(int) (required)
The index of the line in the array. Not used.

Code of Text_Diff::trimNewlines() WP 5.5.3

<?php
static function trimNewlines(&$line, $key)
{
    $line = str_replace(array("\n", "\r"), '', $line);
}