Answers for "js find line break in string"

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
8

javascript line break

//in JavaScript, you can declare a line break (or new line)
//with the \n character.
var linebreak = '\n';
Posted by: Guest on March-26-2020
3

how to print a line in javascript

console.log("Your line would be here")//Prints a line on the console 
alert("Your message here")//Raises an alert
Posted by: Guest on April-27-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language