Returns elements from a sequence as long as a specified condition is true, and then skips the remaining elements.