var lastIndex = s.lastIndexOf(',');
if (lastIndex > -1) {
s = s.substring(0, lastIndex);
}
return s; A 0-based indexed integer indicating the starting position of the substring.
end
Required. A 0-based indexed integer indicating the end of the substring.