Home All Groups Group Topic Archive Search About
Author
12 Apr 2005 7:34 PM
steve
Hi,

I want to extract in separate strings the substrings separated by spaces in
lines like:

A B D between 21.2 32.4
S B V > 332.3
..... etc

where each line is a string.
Since the various substrings are not of constant length, the substring
function is not too useful for me.
I think i can do it with left- right-substrings, but is there a method that
will extract a string between delimiters? (spaces in my case)

TIA

Author
12 Apr 2005 8:05 PM
Cor Ligthert
Steve,

String.Split

I hope this helps,

Cor
Author
12 Apr 2005 8:07 PM
Crouchie1998
Why do you want to extract the letters using substrings when you can use
'Split'?

Crouchie1998
BA (HONS) MCP MCSE
Author
12 Apr 2005 8:09 PM
Chris
Look at the String.Split function.  It should do the trick for you.

Chris

Show quoteHide quote
"steve" <st***@here.com> wrote in message
news:TpV6e.62155$_N4.1386568@wagner.videotron.net...
> Hi,
>
> I want to extract in separate strings the substrings separated by spaces
> in lines like:
>
> A B D between 21.2 32.4
> S B V > 332.3
> .... etc
>
> where each line is a string.
> Since the various substrings are not of constant length, the substring
> function is not too useful for me.
> I think i can do it with left- right-substrings, but is there a method
> that will extract a string between delimiters? (spaces in my case)
>
> TIA
>
Author
12 Apr 2005 8:59 PM
Herfried K. Wagner [MVP]
"steve" <st***@here.com> schrieb:
> I want to extract in separate strings the substrings separated by spaces
> in lines like:
>
> A B D between 21.2 32.4
> S B V > 332.3

'String.Split'/'String.Split'/'Regex.Split'.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>
Author
12 Apr 2005 9:21 PM
Cor Ligthert
Herfried,

>
> 'String.Split'/'String.Split'/'Regex.Split'.
>

Probably

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vafctsplit.asp

:-)

Cor
Author
12 Apr 2005 9:36 PM
Herfried K. Wagner [MVP]
Errata:

> 'String.Split'/'String.Split'/'Regex.Split'.

The first item should read 'Strings.Split'.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>