-3

I want to delete the last and not the initials, I did not find an idea, who is trying

<p id="demo">I want to delete the last and not the initials, I did not find an idea, who is trying</p>

<script>
 document.getElementById("demo").innerText=
  document.getElementById("demo").innerText.replace(  /(.{10})/," " ); 

</script>
SHVFG
  • 11
  • 3
  • 2
    str = string.substring(0, string.length - 10); – Amaresh S M Aug 19 '20 at 06:05
  • 5
    Does this answer your question? [JavaScript chop/slice/trim off last character in string](https://stackoverflow.com/questions/952924/javascript-chop-slice-trim-off-last-character-in-string) – Amaresh S M Aug 19 '20 at 06:06

1 Answers1

1

<p id="demo">I want to delete the last and not the initials, I did not find an idea, who is trying</p>

<script>
document.getElementById("demo").innerText=
 document.getElementById("demo").innerText.replace(  /(.{10})$/," " ); 
  
</script>