js 正则表达式替换字符串中最后一个值

var str= "1,2,3,4,5,";

str = str.replace(/,([^,]*)$/, '。');

猜你喜欢

转载自blog.csdn.net/qq501569325/article/details/112589279