Function replaceScalar [src]
Replace all occurrences of match with replacement.
Prototype
pub fn replaceScalar(comptime T: type, slice: []T, match: T, replacement: T) void Parameters
T: typeslice: []Tmatch: Treplacement: T Source
pub fn replaceScalar(comptime T: type, slice: []T, match: T, replacement: T) void {
for (slice) |*e| {
if (e.* == match)
e.* = replacement;
}
}