Text_Diff::trimNewlines()public staticWP 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.


null. Nothing.


$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.9.3

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