I have a long string that will be displayed on my page. I want it to have a line break after every 40 chars. How can I insert these?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use the
<br>or<wbr>tag:Basically,
<wbr>represents a place where the browser is allowed to break the word on a new line, but it won’t display a space if it doesn’t have to.<br>on the other hand will always create a line break.