Yesterday I missed a delete proc like the de() from this code:
proc de[T](s: var seq[T]; x: T) =
let p = s.find(x)
if p > 0:
delete(s, p)
proc main =
var a = @["aa", "bb", "cc"]
a.de("dd")
echo a
a.de("bb")
echo a
main()
Run
That type of delete is available in Ruby, so one may hope for it in Nim -- well
it is O(N), but maybe still OK for tiny seqs. On can easily guess that one has
to use a combination of find() and delete() for that operation. But when we try
to find find() proc from
[https://nim-lang.org/docs/lib.html](https://nim-lang.org/docs/lib.html)
and type in "find" it is not listed unfortunately, which is a bit confusing.