substring各不同

作者: ldsea 分类: 程序生活 发布时间: 2009-03-02 21:51

js:substring(beginindex, endindex),取得是beginindex到endindex-1位置处的字符串。
java: substring(beginindex, endindex),取得是beginindex到endindex-1位置处的字符串。
c#: substring(beginindex, length),取得是beginindex开始的长度为length的字符串。

比如“0123456”
js: substring(1, 4) 为 “123”
java: substring(1, 4) 为 “123”
c#: substring(1, 4) 为 “1234”

发表回复

您的电子邮箱地址不会被公开。