javascript remove substring after character