Split api not available

scala

#1

Hi , I am not seeing split API not available under filter .

m trying below code.

val orderRevenue = orderItems.filter( oi => oi.split(",")(1).toInt==2).
| map(oi=>oi.split(",")(4).toFloat).
| reduce((t,v) => t+v)

:13: error: value split is not a member of Char
val orderRevenue = orderItems.filter( oi => oi.split(",")(1).toInt==2).
^


#2

Can you share complete code?

You can go through this link to understand how split api works

https://resources.itversity.com/courses/cca-175-spark-and-hadoop-developer-certification-scala/lessons/cca-scala-fundamentals-scala/topic/cca-basic-i-o-operations-and-using-scala-collections-apis-scala/


#3