Results 1 to 4 of 4

Thread: String Manipulation vb.net also asp.net?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 2001
    Location
    UK
    Posts
    99

    String Manipulation vb.net also asp.net?

    hi guys man this project is killing me off, i did this ages ago but forgot asusual i have a string like this:

    Card Title:,Color:,Card Type:,Cost:,Pow/Tgh:,Card Text:,Flavor Text:,Artist:,Rarity:

    i wanna extract say "Card Title:" dump it into a list or something so i can do a for every x in list do


    end for

    and do that to everything between the , on that line, i can make the , anything any ideas, i would also like to do a char count on the "Card Title:" and any other thing i pull out, cheers who ever helps me

    si

  2. #2
    Fanatic Member brown monkey's Avatar
    Join Date
    Jun 2004
    Location
    Cebu
    Posts
    552
    i want to help but don't know what to help. hehe. cheers mate. perhaps you could try split(input_string,","). string array receives this function. and you can do for each string in the array.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Nov 2001
    Location
    UK
    Posts
    99
    drew a massive paper diagram and some dodgy code last night, i think i might wrk, im gonna put it into VS today, seems sound, hope it works lol

  4. #4
    Frenzied Member <ABX's Avatar
    Join Date
    Jul 2002
    Location
    Canada eh...
    Posts
    1,622
    VB Code:
    1. Const strSample as String = "Card Title:,Color:,Card Type:,Cost:,Pow/Tgh:,Card Text:,Flavor Text:,Artist:,Rarity"
    2.  
    3. Dim strFields() as String = Split(strSample, ",")
    4.  
    5. For I as Integer = 0 to strFields.Length - 1
    6.     Msgbox strFields(I)
    7. Next
    Tips:
    • Google is your friend! Search before posting!
    • Name your thread appropriately... "I Need Help" doesn't cut it!
    • Always post your code!!!! We can't read your mind!!! (well, at least most of us!)
    • Allways Include the Name and Line of the Exception (if one is occuring!)
    • If it is relevant state the version of Visual Studio/.Net Framwork you are using (2002/2003/2005)


    If you think I was helpful, rate my post
    IRC Contact: Rizon/xous ChakraNET/xous Freenode/xous

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width