World Of Webmaster
Đăng nhập / Đăng ký
Account
Free for web
Check pagerank
Input check pager (Not http://)

Ext: blog.kai.vn
Check google pagerank
View HTML source
FUNCTION LIBRARY
HTML Tags Library
PHP Functions Library ASP Functions Library
ASP Functions SplitRegExp
Chức năng: Tách chuổi ký tự dựa vào một chuổi xác định
Ngôn ngữ: asp - Nhóm: array
CÚ PHÁP
  arrayOfStrings = SplitRegExp(stringInput, stringPattern, boolIgnoreCase)

Sử dụng để tách chuổi ký tự thành một mảng dựa vào một hoặc chuổi ký tự xác định trong chuổi ban đầu.

VÍ DỤ
<%
  dim s, arr, element
  
    s = "grgrg~|~item2bcs~|~item3~|~item4~|~d~|~sds"
      arr = SplitRegExp(s, "\~\|\~", true)
  response.write s & "<BR><BR>"
  for each element in arr
      response.write element & "<BR>"
  next
  
  'returns:
  '
  ' "grgrg~|~item2bcs~|~item3~|~item4~|~d~|~sds"
  '
  ' "grgrg"
  ' "item2bcs"
  ' "item3"
  ' "item4"
  ' "d"
  ' "sds"
%> 
ASP Code
<%
  function SplitRegExp(byval sInput, byval sPattern, byval bIgnoreCase)
      dim re, matches, match, hStart, hEnd, i
  
      Set re = new regexp
      re.pattern = sPattern
      re.ignorecase = bIgnoreCase
      re.global = true
  
      if not re.test(sInput) then
          splitregexp = array(sInput)
  
          set re = nothing
          exit function
      end if
  
      set matches = re.execute(sInput)
      hStart = 0
      redim arr(matches.count)
      i = 0
      for each match in matches
          hEnd = match.firstindex
          arr(i) = mid(s, hStart+1, hEnd - hStart)
          hStart = match.firstindex + match.length 
          i = i + 1
      next
      arr(ubound(arr)) = mid(s, hStart+1)
      set matches = nothing
      Set re = nothing
      splitregexp = arr
  end function
%> 

StrToArray
SelectionSort
RevArray
RemDups
RandomArray
MultiArraySort
HasDups
ExchangeSort
ArrayAverage
CombSort
Library ›› HTML Tag | PHP Function | ASP Function
Page : 806722
Online :
Visited : 370047
 
Liên h | Thêm vào Favorite | Gửi link qua e-mail | Thông tin website
Copright © 2009 KAI Blog
Code by BOINGOnline. Contact email : contact@kai.vn
Theme: default | classic |