split function

1. Member
Join Date
Dec 1969
Posts
30

## split function

is there a way to split something while keeping the delimiters intact?<BR><BR>for example<BR>a = "a;b;c;d;e"<BR>x = split(a,";")<BR><BR>x(0) will equal a, x(1) eq ;b, x(2) = ";c" ... etc<BR><BR>how though?<BR><BR>ted

2. Senior Member
Join Date
Dec 1969
Posts
1,686

## Why not

do your split, then<BR><BR>for i = 0 to uBound(myArray)<BR> myArray(i) = myArray(i) & ";"<BR>next<BR>

3. Senior Member
Join Date
Dec 1969
Posts
1,024

## RE: split function

for example <BR>Well, if you really wanted to<BR>a = "a;b;c;d;e" <BR>x = split(a,";") <BR><BR>i=1<BR><BR>Do<BR>x(i)=";" &x(i)<BR>i=i+1<BR>Loop until i= Ubound(x, 1)<BR><BR>Note that you start from x(1) because you don&#039;t want to add one before the first value.<BR><BR>Let us into your secret then; Why the hell would you want to do that?

4. Member
Join Date
Dec 1969
Posts
30

## RE: split function

i want to do that because i&#039;m writing a taf weather report parsing program. I&#039;m going to be splitting the line that&#039;s going to get chewed on by this regular expression a few different ways, and i&#039;d like to just break it up on certain fields. They&#039;re pretty goofy and difficult to learn. If you care, go here. https://weather.afwa.af.mil/nwconus_alphanum.html<BR><BR>BTW I can&#039;t believe i didn&#039;t think of that. doh!

#### Posting Permissions

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