I need to write a function that takes a Tuple of String of any size, call trims on each element and returns a new tuple. I am kind of stuck at this point below and the code is already not type safe. In addition I do not know how to go back to a tuple once I convert it to an Iterator. Is there a more elegant way to solve this problem? The solutions needs to work on Scala 2.9.2
def trim(input:Product)={
input.productIterator.asInstanceOf[Iterator[String]].map(_.trim)
}