Replace the last occurrence of a string with another string
The replaced string
type Value = 'foofoofoo';
type Target = 'foo';
type Replacement = 'bar';
type Result = ReplaceLast<Value, Target, Replacement>; // 'barbarbar'
type Value = 'foofoofoo';
type Target = 'foo';
type Replacement = 'bar';
type Result = ReplaceLast<Value, Target, Replacement, false>; // 'foofoobar'
ReplaceLast