문제

I have this string and I want to create a filter to cut the last 10 chars

thanks

var date ="2014-04-15T07:00:00.000Z";

date = str.slice(0,10)
도움이 되었습니까?

해결책

var date ="2014-04-15T07:00:00.000Z";
date = date.substring(0, date.length - 10);

removes the last 10 characters of variable date and returns "2014-04-15T07:".

Fiddle.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top