V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
Livid
268.49D
570.82D
V2EX  ›  Lua

为什么 Lua 本身不包含像 endswith() 之类的特别常用的字符串函数呢?

  •  
  •   Livid ·
    PRO
    · Jan 8, 2015 · 7873 views
    This topic created in 4133 days ago, the information mentioned may be changed or developed.
    是因为什么样的设计哲学方面的原因么。

    http://lua-users.org/wiki/StringRecipes
    4 replies    2015-02-18 00:39:19 +08:00
    hicdn
        1
    hicdn  
       Jan 8, 2015
    split 也需要自己实现
    wanjun
        2
    wanjun  
       Jan 8, 2015
    C有么?
    cctvsmg
        3
    cctvsmg  
       Jan 8, 2015
    大概是因为懒,lua更新太慢了,包管理系统又不完善
    imzyxwvu
        4
    imzyxwvu  
       Feb 18, 2015
    lua感觉喜欢用比较简单的东西实现复杂的事情吧。你可以用string.match(str, "abcdef$")代替endswith。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2396 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 45ms · UTC 04:32 · PVG 12:32 · LAX 21:32 · JFK 00:32
    ♥ Do have faith in what you're doing.