Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

remove on condtion in vec rust

let mut vec = vec![1, 2, 3, 4];
vec.retain(|&x| x % 2 == 0);
assert_eq!(vec, [2, 4]);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #remove #condtion #vec #rust
ADD COMMENT
Topic
Name
6+5 =