Re: Find a String in VB.NET

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Cor Ligthert (notfirstname_at_planet.nl)
Date: 06/08/04


Date: Tue, 8 Jun 2004 15:48:58 +0200

Hi Steve

Have a look at the split method

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

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
> |
> |
>
>



Relevant Pages

  • Search pattern
    ... Dim strfile As String ... Dim bAddressFound As Boolean ... Dim strCurrentChar As String ...
    (comp.databases.ms-access)
  • Auto Write Name and Merge across
    ... Dim Sheetname01 As String ... Dim WeekName01 As String ...
    (microsoft.public.excel.misc)
  • Re: multiplatform (pocketPC & desktopPC) (Daniel !!)
    ... Friend Versione As String ... Public Sub GetMyConnectionPalmare() ... Dim errorMessages As String ... Private Function GetDS_Desktop(ByVal SQL As String) As DataSet ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: multiplatform (pocketPC & desktopPC) (Daniel !!)
    ... Friend Versione As String ... Public Sub GetMyConnectionPalmare() ... Dim errorMessages As String ... Private Function GetDS_Desktop(ByVal SQL As String) As DataSet ...
    (microsoft.public.dotnet.framework.compactframework)
  • Help answer these 70-310 questions
    ... One argument is the string ... Dim output As New StringBuilder ... EmployeeLocations. ... You create a strongly named serviced component. ...
    (microsoft.public.cert.exam.mcsd)