Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {3, -5, 2, 7, -6, 3} /. x_ /; x < 0 :> 0
- (*{3, 0, 2, 7, 0, 3}*)
- {3, -5, 2, 7, -6, 3} /. _?Negative :> 0
- (*{3, 0, 2, 7, 0, 3}*)
- {3, -5, 2, 7, -6, 3} /. _?(< 0) :> 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement