PHP
(simple examples)
$str = "Hello World Foo Bar!"; $nobreak = str_replace(["\r", "\n"], "", $str);
$str = "Hello World Foo Bar!"; $nobreak = preg_replace("/\r|\n/", "", $str);
$str = " Hello World "; ONLY REMOVES LEADING & TRAILING LINE BREAKS $nobreak = trim($str);
$str = "Hello<br>World"; $nobreak = str_replace(["<br>", "<br/>"], "", $str);