Summary
Replaces the specified item.
Syntax
public static void Replace<T>(this IList<T> source, T original, T replaceWith, IEqualityComparer<T> comparer)
Type Parameters
Name |
Description |
T |
The type of item. |
Parameters
Name |
Type |
Description |
source |
IList<T> |
The source. |
original |
T |
The item which is to be replaced. If not in the list and argument exception will be thrown. |
replaceWith |
T |
The new item. |
comparer |
IEqualityComparer<T> |
The equality comparer to be used to find the original item in the list. |
Return Value