subject, or the original
array if no match is found.
E[] replaceLast(E, R1, R2)(E[] subject, R1 from , R2 to) if (isDynamicArray!(E[]) &&
isForwardRange!R1 && is(typeof(appender!(E[])().put(from[0 .. 1]))) &&
isForwardRange!R2 && is(typeof(appender!(E[])().put(to[0 .. 1]))))Replaces the last occurrence of from with to in subject.
subject | the array to scan |
from | the item to replace |
to | the item to replace from with |
subject, or the original
array if no match is found.