String Slicing
Given two strings
Sample Input 1
JavaScript
S
Sample Output 1
Script
Sample Input 2
Language
air
Sample Output 2
Language
var str= "Everything is fine";
var splitted = str.split('is');
var first = splitted[0];
var second = splitted[1];
console.log('First is: ' + first + ', and second is: ' + second);
document.getElementById("demo").innerHTML =
"The value of new is: " + splitted;
Comments
Leave a comment