flatmap
函数的定义
def flatMap[B](f: (A) ⇒ GenTraversableOnce[B]): Seq[B]
[use case]
Builds a new collection by applying a function to all elements of this sequence and using the elements of the resulting collections.
B the element type of the returned collection.
f the function to apply to each element.
returns a new sequence resulting from applying the given collection-valued function f to each element of this sequence and concatenating the results.作用
Last updated