how to limit length of string javascript code example Example: js string limit length string.substring(0,lengthRequired+1);