Re: Find a String in VB.NET
From: Cor Ligthert (notfirstname_at_planet.nl)
Date: 06/08/04
- Next message: Sameh Ahmed: "Re: passing variable between forms"
- Previous message: jcrouse: "RE: creating controls at runtime"
- In reply to: steve: "Re: Find a String in VB.NET"
- Next in thread: steve: "Re: Find a String in VB.NET"
- Reply: steve: "Re: Find a String in VB.NET"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 8 Jun 2004 15:48:58 +0200
Hi Steve
Have a look at the split method
That is in my opinion made for your problem
I hope this helps?
Cor
"steve" <a@b.com> schreef in bericht
news:10ca3sfsgsko595@corp.supernews.com...
> dim criteria as string = "(frederico)|(FGB)"
> dim pattern as string = "(^" & criteria & ",?)|(,?" & criterion &
",?)|(,?"
> & criterion & "$)"
> dim regExp as new regEx(pattern)
> dim match as match
> dim yourString as string =
"000,federico,00,439827HGH,1233,FGB,0000,00,000"
> for each match in regExp.Matches(yourString)
> console.writeline(match.value)
> next
>
> or something therebouts.
>
> hth,
>
> steve
>
>
> "Federico G. Babelis" <federico@gazum.com> wrote in message
> news:uCaeZEPTEHA.1768@TK2MSFTNGP10.phx.gbl...
> | Hi,
> |
> | I need to extract a string from another string separated by "," like a
> .csv
> | file.
> | for example I have this string:
> |
> | String1 = 000,federico,00,439827HGH,1233,FGB,0000,00,000
> |
> | and from that string i need to extract string "federico" and string
"FGB"
> | and separate then into another 2 strings:
> |
> | String2 = "federico"
> | String3 = "FGB"
> |
> | How this could be done in Visual Basic .NET ????
> |
> | Thanks and best regards,
> | Federico
> |
> |
>
>
- Next message: Sameh Ahmed: "Re: passing variable between forms"
- Previous message: jcrouse: "RE: creating controls at runtime"
- In reply to: steve: "Re: Find a String in VB.NET"
- Next in thread: steve: "Re: Find a String in VB.NET"
- Reply: steve: "Re: Find a String in VB.NET"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|