你试试,应该可以满足你的要求,希望采纳。function formatDate(str){ const reg = /(\d\d)(?=\d+)/g str = str.replace(reg, '$1:') return str }
你试试,应该可以满足你的要求,希望采纳。