I have a problem I want to change the length of string. This is my string of characters that I want to change.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim .
I use substring function in javascript but the outputs is not like I need.
this is my code
var str="Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ";
document.write(str.substring(100)+"<br />");
but the output is like this
laoreet dolore magna aliquam erat volutpat. Ut wisi enim
My goal is just to make the length of that string of character to be 100 starting from the first character.
how i can solve this...thanks for your answer
document.writeanymore? The answer to your question is already in my answer.str.substring(0, 100).