如果你只想留数字
var str = "2003年";
str = str.replace(/[^\d]*/g,"");如果你想把年换成另一字符
var str = "2003年";
str = str.replace("年","哈哈");
var str = "2003年";
str = str.replace(/[^\d]*/g,"");如果你想把年换成另一字符
var str = "2003年";
str = str.replace("年","哈哈");
str=trim(replace(str,"年","想要替换后的字符"))