var theString = "abc",
allSubstrings = [];
getAllSubstrings(theString);
function getAllSubstrings(str) {
for (let i = 0; i < str.length; i++) {
for (let j = i + 1; j <= str.length; j++) {
allSubstrings.push(str.substring(i, j));
}
}
}
console.log(allSubstrings);
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)