split()函数怎么用??急!!

zhuyuantan 2002-01-10 09:41:02
它返回什么东西?
请讲通俗点。
...全文
147 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
sportdog 2002-01-12
  • 打赏
  • 举报
回复
msdn 上不是有吗?
Soft21 2002-01-12
  • 打赏
  • 举报
回复
大家好啊,我得好好看看书了,不好意思。
mjs2000 2002-01-10
  • 打赏
  • 举报
回复
如果是jscript
ss=str.split(strx)
str为字符串strx可以说是正则表达是通常我们把它简化为分割付
例如
var ss,str
str="a,b,c,xc,x"
ss=str.split(",")
将得到ss[5](0---4)的一个数组
如果是vbscript更能使一样的
dim ss str
str="a,b,c,xc,x"
ss=split(str,",")
将得到ss(5)(0---4)的一个数组

Split
Returns a zero-based, one-dimensional array containing a specified number of substrings.

Syntax
Split(expression[, delimiter[, count[, compare]]])

The Split syntax has these parts:

Part Description
expression Required. String expression containing substrings and delimiters. If expression is a zero-length string, Split returns an empty array, that is, an array with no elements and no data.
delimiter Optional. String character used to identify substring limits. If omitted, the space character (" ") is assumed to be the delimiter. If delimiter is a zero-length string, a single-element array containing the entire expression string is returned.
count Optional. Number of substrings to be returned; -1 indicates that all substrings are returned.
compare Optional. Numeric value indicating the kind of comparison to use when evaluating substrings. See Settings section for values.


Settings
The compare argument can have the following values:

Constant Value Description
vbBinaryCompare 0 Perform a binary comparison.
vbTextCompare 1 Perform a textual comparison.
vbDatabaseCompare 2 Perform a comparison based on information contained in the database where the comparison is to be performed.

ssm1226 2002-01-10
  • 打赏
  • 举报
回复
上面的已经够多的啦,我就不多说啦
希偌 2002-01-10
  • 打赏
  • 举报
回复
这是分解数组元素的函数!
lqg1 2002-01-10
  • 打赏
  • 举报
回复
Split 函数
返回基于 0 的一维数组,其中包含指定数目的子字符串。

Split(expression[, delimiter[, count[, start]]])

参数
expression

必选项。字符串表达式,包含子字符串和分隔符。如果 expression 为零长度字符串,Split 返回空数组,即不包含元素和数据的数组。

delimiter

可选项。用于标识子字符串界限的字符。如果省略,使用空格 ("") 作为分隔符。如果 delimiter 为零长度字符串,则返回包含整个 expression 字符串的单元素数组。

count

可选项。被返回的子字符串数目,-1 指示返回所有子字符串。

Compare

可选项。指示在计算子字符串时使用的比较类型的数值。有关数值,请参阅“设置”部分。


设置
compare 参数可以有以下值:

vbBinaryCompare 0 执行二进制比较。
vbTextCompare 1 执行文本比较。

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧