string数组在scala中用什么表示
1个回答
展开全部
(这种极朴素的代码如下)
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}
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}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询