Scala遍历java数组

import scala.collection.JavaConversions._

def json2seg(segmentJSON: String): String = {
    val set = JSON.parseObject(segmentJSON).keySet()
    import scala.collection.JavaConversions._
    var segwhere = "("
    for (k <- set) {
      segwhere += "node like '%" + k + "%' or "
    }
    segwhere = segwhere.patch(segwhere.lastIndexOf('r'), "", 1)
    segwhere = segwhere.patch(segwhere.lastIndexOf('o'), "", 1)
    segwhere += ")"
    segwhere
  }

你可能感兴趣的:(scala,scala,开发语言,后端)