javascript - how to put ... if string length is over 12 -


facebook_user_name=facebook_info[0].url[j]; if(facebook_user_name.length>12) {  } 

how put ... if string length on 12. example, name aaaaaaaa bbbbbbb result should aaaaaaaa bbb... thank in advance.

var substring = facebook_user_name.substr(0, 12) + '...'; 

Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -