Remove all items from a list after a item

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By hashak
var array = ["a", "b", "c", "d"]

How can I remove all items after “b”.

:bust_in_silhouette: Reply From: volzhs
var array = ["a", "b", "c", "d"]
array.resize(2)
print(array)