Re: Find a String in VB.NET

From: steve (a_at_b.com)
Date: 06/08/04


Date: Tue, 8 Jun 2004 11:28:28 -0500

i gave a split method example too...look in this thread. also, i'm not the
op. i gave two examples b/c of the vagueness in the description of what the
op is trying to acheive...one being a delimited string search returning
matches...the other treating the input as a cvs, tick (') encapsulted, comma
separated stream of data. hopefully, one of the two is exactly what's
needed...else, there is enough there for the op to work with.

thanks for your thoughts though.

post you later, cor.

steve

"Cor Ligthert" <notfirstname@planet.nl> wrote in message
news:OXlQ29VTEHA.3332@tk2msftngp13.phx.gbl...
| 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

  • RE: Error Trap not working
    ... "Steve C" wrote: ... Dim ColAAddress As String, ColAName As String, ColBRange as String ... 'Code here that names the range of cells in Col. B as ColBRange ...
    (microsoft.public.excel.programming)
  • Re: mdb field maintenance
    ... Bill ... > Dim dbs As DAO.Database ... > Public Function FieldExists(strTable As String, ... > Steve Schapel, Microsoft Access MVP ...
    (microsoft.public.access.formscoding)
  • RE: Duplicating A Record with Null values
    ... Steve S ... Only strDeliverable5 is delcared as a String ... Dim Null_Deliverable2 As String ...
    (microsoft.public.access.forms)
  • SQL syntax error?
    ... *Steve places dunces cap on head and stands in corner:)* ... >>this the code has to know where the backend is located. ... >> Dim tdf As TableDef ... >> Dim strCon As String ...
    (microsoft.public.access.modulesdaovba)
  • Split Method
    ... I am trying to use the Split method on a string. ... If I try to split the string using a space as the delimiter, ... Dim Attributes As String= mvRec.Split) ...
    (microsoft.public.dotnet.framework.compactframework)