I am working with a string that I want to slice 22 characters from the beginning and then determine the count of remaining characters.
For example - Red, Blue, ABC, Test1, REN, Green, Test, Red - Total 37 characters
Desired Output:
Red, Blue, ABC, Test1, REN --------------- 15
Out of a total of 37 characters, 22 have been sliced and there are 15 characters remaining in the string.
Here is my code snippet:
viewMore(text) {
if (text.values) {
const enumText = text.values[0];
return enumText.slice(0, 22) + (enumText.length > 22 ? enumText.length : "");
}
}
Please Find Attached https://i.sstatic.net/nORQP.png