javascript substring after last occurrence