最赞回答 / ld1987
不计算空格?怎么可能啊。document.write( mystr.substr( mystr.indexOf("l"),5) ); 运行结果是 llo W 明显把空格算进去了的
2014-10-30
已采纳回答 / 偌颜宁
建议采用参考代码中time.getHours()+":"+time.getMinutes()+":"+time.getSeconds();的这种方法toLocaleTimeString()方法是根据本地时间格式,把 Date 对象的时间部分转换为字符串,带上下午的
2014-10-30