Pattern Matching

Results 1 to 2 of 2

Thread: Pattern Matching

  1. #1
    Join Date
    Dec 1969

    Default Pattern Matching

    I will like to know if ASP is able to perform pattern matching. For example, if I were to read 03012000 into a variable, is there any way I can like say split 03 into one variable, 01 into another variable and 2000 yet into another variable?<BR><BR>Thank you for your respond.

  2. #2
    Join Date
    Dec 1969

    Default RE: Pattern Matching

    Yes; use the Mid function to pick apart strings. For example, if I wanted to break an 8 character length string into three strings length 2, 2, and 4, I could do:<BR><BR>Dim strMonth, strDay, strYear, strLongDate<BR>strLongDate = "08011978" &#039my birthday!<BR><BR>strMonth = Mid(strLongDate,1,2)<BR>strDay = Mid(strLongDate,3,2)<BR>strYear = Mid(strLongDate,5,4)<BR><BR><BR>To learn more about the Mid function, check out:<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts