Delete element in an array for julia

You can also go with filter!:

a = Any["D", "A", "s", "t"]
filter!(e->e≠"s",a)
println(a)

gives:

Any["D","A","t"]

This allows to delete several values at once, as in:

filter!(e->eāˆ‰["s","A"],a)

Note 1: In Julia 0.5, anonymous functions are much faster and the little penalty felt in 0.4 is not an issue anymore šŸ™‚ .

Note 2: Code above uses unicode operators. With normal operators: ≠ is != and eāˆ‰[a,b] is !(e in [a,b])

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)