Tuesday, November 9, 2021

JAVASCRIPT - How to split string into parts

var s = "This;is;a;text";
var vars = s.split( ";" );
vars.forEach( element => {
  document.write( element + "
" ); } );
Output:
This
is
a
text

No comments:

Post a Comment