Searching And Splitting an array

Results 1 to 2 of 2

Thread: Searching And Splitting an array

  1. #1
    Morebyte Guest

    Default Searching And Splitting an array

    Is there a way that I can search a string for a specific sequence of characters, and then split on that sequence if they are found.<BR><BR>Here would be my string: SmallApartments&#062;=0<BR>I want to search of &#039;&#062;=&#039; is this string,<BR>Charactersequence would be the string that would return true,<BR>as this sequence &#039;&#062;=&#039; would.<BR>and then do a split(mystring, charactersequce) &#060;-- like that<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Searching And Splitting an array

    You could certainly do this:<BR><BR>&#060;%<BR>If InStr( mystring, charactersequence ) &#062; 0 Then<BR>&nbsp; &nbsp; ar = Split( mystring, charactersequence )<BR>&nbsp; &nbsp; ...<BR>End If<BR>%&#062;<BR><BR>But why not just *DO* the split, unconditionally? Then check the size of the array. If there is more than one element, it means that the sequence was found. That is, IF UBOUND(ar) &#062; 0 THEN ...<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