分离分隔值是一种很有用的工具特别是在不止一个被允许的选项或者多个复选框被用作输入表单的情况下利用下拉菜单。分裂函数会放一个数量,在变量名称后面以0开始作为插入语。未绑定的函数会分辨出能找到多少分隔值。
<%
u_input=request.querystring("u_input")
if u_input ="" then
u_input ="a,b,c,d"
end if
g_input=s Separating Delimited Values plit(u_input,",")
num_inputted=ubound(g_input)
%>
<form>
<input type = "text" name = "u_input" value = "<%= u_input %>">
<input type = "submit" value = "Submit">
</form>
User Input: <%= u_input %><br>
Number of Inputted Values: <%= (num_inputted + 1) %><br>
<% for counter =0 to num_inputted %>
User Inputted Value(<%= counter %>) = <%= g_input(counter) %><br>
<% next %>
<%
u_input=request.querystring("u_input")
if u_input ="" then
u_input ="a,b,c,d"
end if
g_input=s Separating Delimited Values plit(u_input,",")
num_inputted=ubound(g_input)
%>
<form>
<input type = "text" name = "u_input" value = "<%= u_input %>">
<input type = "submit" value = "Submit">
</form>
User Input: <%= u_input %><br>
Number of Inputted Values: <%= (num_inputted + 1) %><br>
<% for counter =0 to num_inputted %>
User Inputted Value(<%= counter %>) = <%= g_input(counter) %><br>
<% next %>
本文介绍了一种使用下拉菜单和复选框等输入表单元素进行数据分隔的方法,并通过示例展示了如何将字符串按指定字符分割为数组,便于进一步处理。文中详细解释了从用户输入中获取数据并将其分割的过程。
1625

被折叠的 条评论
为什么被折叠?



