I have the string as show below:
XXX:Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur cursus lacus sed
justo faucibus id pellentesque nunc porttitor. Sed venenatis tempor dui, nec mattis dolor
ultrices at. Duis suscipit, dolor sed fringilla interdum, magna libero tempor quam, sed
molestie dui urna sed tellus.
How can I add a restriction and cut the string off at the first line? (using javascript).
The end result I would expect is as follows:
XXX:Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur...
var firstLine = theString.split('\n')[0];