Answers for "how to short string in javascript"

4

How to make string shorter javascript

const string = "Name".slice(0, 250).concat('...');
const string2 = "Name".substring(0, 250).concat('...');
Posted by: Guest on February-22-2020
4

javascript truncate string

var string = "ABCDEFG";
var truncString = string.substring(0, 3); //Only keep the first 3 characters
console.log(truncString); //output: "ABC"
Posted by: Guest on May-20-2020
0

shorten string js

let str = "Hello world!";
str.slice(0, 5)   // Returns "Hello"
Posted by: Guest on July-29-2021
0

short string javascript

short = long.replace(/(.{7})..+/, "$1…");
Posted by: Guest on October-23-2020

Code answers related to "how to short string in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language