Text_Diff::trimNewlines()public staticWP 1.0

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

Method of the class: Text_Diff{}

No Hooks.

Return

null. Nothing (null).

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.

Text_Diff::trimNewlines() code WP 6.5.2

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