Answers for "remove line break character from string js"

8

javascript remove line breaks from string

var stringWithLineBreaks = `
O boy 
I've got 
Breaks
`;
var stringWithoutLineBreaks = stringWithLineBreaks.replace(/(\r\n|\n|\r)/gm, "");//remove those line breaks
Posted by: Guest on August-05-2019
1

Remove line breaks with JavaScript

String.replace(/(\r\n|\n|\r)/gm," ")
Posted by: Guest on December-10-2020
0

remove line break javascript

<script type="text/javascript">
    var get_banner_detail = `<?php echo json_encode($get_banner_detail); ?>`;

    exam = get_banner_detail.replaceAll(/(\r\n|\n|\r)/gm, '<br>');
</script>
Posted by: Guest on August-11-2021

Code answers related to "remove line break character from string js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language