I have a function below that I want to use to return a slice of characters with a count as shown in the example below.
Example - abcd,test,red,blue,green,yellow
Expected output -
abcd,test,red,blue,g.........................(11)
My code works correctly but instead of using "------" I would like to have spaces between the count numbers.
viewMore(text) {
if (text.tag_value_constraint && text.tag_value_constraint.values) {
const enumText = text.tag_value_constraint.values[0];
const count = 30;
return enumText.slice(0, count) + (enumText.length > count ? " ("+(enumText.length - enumText.slice(0, count).length)+")" : "");
}
}