Re: getting Nth position in a comma delimited string..



Thank you!

"Shane Story" <nospam@xxxxxxxxxxxx> wrote in message
news:%233%23GeoHnFHA.1204@xxxxxxxxxxxxxxxxxxxxxxx
> hazz,
>
> Why not Split them and use trim on the strings?
>
> Dim s As String = "a, b, c, d"
> MsgBox(s.Split(",")(1).Trim)
>
> HTH,
>
> Shane Story
>
>
>
> "hazz" <hazz@sonic_net> wrote in message
> news:OCaJeaHnFHA.3380@xxxxxxxxxxxxxxxxxxxxxxx
>> yes i should know this but ...
>>
>> V,-1,1,2,-1,333,5
>>
>> I would like to return the value from any position within the comma
>> delimited string
>>
>> position 1 is "v"
>> position 2 is "-1"
>> position 6 is "333"
>>
>> at first I thought I could use string.chars(n) until I realized that
>> 1. There are commas and that the spaces between the commas vary so I have
>> to use an algorithm and function(s) that look for
>> 1. the first item contained before the first comma,
>> 2 the second item contained between the first and second comma,
>> 3 the third item contained between the second and third,
>> etc.
>>
>> thank you,
>> -hazz
>>
>
>


.



Relevant Pages

  • Comma in Web Part parameters
    ... I have two webparts, one providing to strings, the other one reciving the two strings. ... If I have a comma in the first parameter the parameter is striped after the comma and the second parameter is empty. ... In my logfiles I can see, that the first web part fires his event with the correct parameters but the second one recives the corrupted data. ...
    (microsoft.public.sharepoint.portalserver.development)
  • Re: RFC: Representation of large hex values
    ... Replacing the comma with the underscore and moving the whole shebang ... to printf/scanf sounds like a good idea to me. ... like strings and ints. ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • Re: Using the same subroutine to read files with different structures
    ... tokenizes to either space and comma delimited strings or space and comma ... returns an array of keyword strings ...
    (comp.lang.fortran)
  • Re: getting Nth position in a comma delimited string..
    ... Dim s As String = "a, b, c, d" ... HTH, ... Shane Story ... > I would like to return the value from any position within the comma ...
    (microsoft.public.dotnet.languages.vb)
  • Unexpected string behaviour: txt = this works
    ... I did a double take when debugging an error the other day. ... problem was missing out a comma when building a list of strings. ...
    (comp.lang.python)