ï¼è¿ç§ææ´ç´ ç代ç å¦ä¸ï¼
val strArray: Array[String]
// here are some codes that read strings from a file to the strArray
val doubleArray: Array[Double] = new Array[Double](strArray.length)
var i=0
for(eachstr <- strArray) {doubleArray(i) = eachstr.toDouble; i+=1}
温馨提示:答案为网友推荐,仅供参考