sevenLee
10/14/2015 - 5:54 PM

Javascript_Base_String_substring_slice

Javascript_Base_String_substring_slice

var href = "/Controller/Action?id=11112&value=4444";
href = href.replace(/\?.*/,'');
href ; //# => /Controller/Action
var startStr = longString.substring(0, 10);
var endStr = longString.slice(-8);
var truncateStr = startStr+" ... "+endStr;

//eyJ0eXAiOi ... cdmKmClg