变量取值中遇到的问题

 所属目录:Java   |   类型:技术问答   |   时间:2007-05-21
 问题:

多个参数负值到一个变量,用","分隔  
   
  对变量取值   得到结果:  
   
  1,12,3,5,9,6  
   
   
  如何分别获取   1   12   3     ...   6   ?

· 网友精彩回答:

发表者:zhongq99

list   =   "1,12,3,5,9,6"  
  while   instr(list,   ",")   >   0  
          value   =   trim(left(list,   instr(list,   ",")   -   1))  
          list   =   trim(right(list,   len(list)   -   instr(list,   ",")))  
  wend  
  value   =   trim(list)  
  这样取出来是字符,不过换换类型就ok了  
 

发表者:majiming

list="1,12,3,5,9,6"  
  ma=split(list,",")  
  for   i=0   to   ubound(ma)  
  response.write   ma(i)  
  next

发表者:kendo7

dim   myarray  
  dim   list  
  list="1,12,3,5,9,6"  
  myarray=dropstr(list)  
  for   i=0   to   ubound(myarray)  
      response.write   myarray(i)   &   "<br>"  
  next  
   
  function   dropstr(list)  
  dim   ma  
  ma=split(list,",")  
  for   i=0   to   ubound(ma)  
    ma(i)=trim(ma(i))       去掉这里的空格  
  next  
  dropstr=ma  
  end   function

.
处理 SSI 文件时出错
© 2006-2008 All Rights Reserved