Q:

Scala Converting Each Array Element to String and Splitting

I have an array loaded in, and been playing around in the REPL but can't seem to get this to work.  
My array looks like this:
record_id|string|FALSE|1|
offer_id|decimal|FALSE|1|1,1
decision_id|decimal|FALSE|1|1,1
offer_type_cd|integer|FALSE|1|1,1
promo_id|decimal|FALSE|1|1,1
pymt_method_type_cd|decimal|FALSE|1|1,1
cs_result_id|decimal|FALSE|1|1,1
cs_result_usage_type_cd|decimal|FALSE|1|1,1
rate_index_type_cd|decimal|FALSE|1|1,1
sub_product_id|decimal|FALSE|1|1,1
campaign_id|decimal|FALSE|1|1,1

When I run my command:
for(i <- 0 until schema.length){  
    val convert = schema(i).toString; 
    convert.split('|').drop(2); 
    println(convert);
}

It won't drop anything.  It also is not splitting it on the | 

A:

Strings are immutable, and so split and drop don't mutate the string - they return a new one. 
You need to capture the result in a new val
val split = convert.split('|').drop(2); 
println(split.mkString(" "));

