var example = "I am too long string"; var result; // Slice is JS function result = example.slice(0, 10)+'...'; //if you need dots after the string you can add