R
R
rd1002021-10-05 17:54:35
JavaScript
rd100, 2021-10-05 17:54:35

How to start searching for a match from the end of a string?

https://jsfiddle.net/2mocyaef/

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2021-10-05
@rd100

str.replace(/,(?=[^,]*$)/, ' and')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question