当前位置:网站首页>Scala IO reads data from URLs and other data sources

Scala IO reads data from URLs and other data sources

2022-06-24 23:38:00 Jue Niu thunder plough hot blade

import scala.io.Source

object D04_ from URL And other data sources  {
    

  def main(args: Array[String]): Unit = {
    
    readFromURL()
// readFromStr()
  }

  def readFromURL(): Unit = {
    
    val source = Source.fromURL("https://www.itcast.cn/")
    val str = source.mkString
    println(str)
  }

  def readFromStr(): Unit = {
    
    val source = Source.fromString(" Black horse programmer ")
    val value = source.mkString
    println(value)
  }

}
原网站

版权声明
本文为[Jue Niu thunder plough hot blade]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202211118166446.html