V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
orbwalker
V2EX  ›  问与答

-- 关于 scala 中的 list 常用方法

  •  
  •   orbwalker · Nov 19, 2019 · 1344 views
    This topic created in 2352 days ago, the information mentioned may be changed or developed.

    问:这三种情况好像用数组匹配做不了,怎么用 List 的列表匹配方法呢?

    
    /**
    TODO: 列表匹配
    1.以 5 结尾
    2.包含 5
    3.以 5 开头
    */

    object Exercise01 { def main(args: Array[String]): Unit = { val list = (1 to 10).toList list match { } } }

    1 replies    2019-11-19 10:36:35 +08:00
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1192 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 23:13 · PVG 07:13 · LAX 16:13 · JFK 19:13
    ♥ Do have faith in what you're doing.