Results 1 to 2 of 2
  1. #1
    ppl2pass's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Posts
    804
    Reputation
    5
    Thanks
    111
    My Mood
    Amused

    Question [Help]parse a word

    How do i call it.

    For example the line is: MPGH is the best site eva.
    How do i parse the line if i wanted only the word "best".

    Code:
    Function Parse(ByVal Data As String, ByVal Left As String, ByVal Right As String) As String
            If Dat*****ntains(Left) AndAlso Dat*****ntains(Right) Then
                Return Data.Substring(Data.IndexOf(Left) + Left.Length, Data.IndexOf(Right) - Data.IndexOf(Left) - Left.Length)
            Else
                Return String.Empty
            End If
        End Function

  2. #2
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed


    My String Manipulation Tutorial
    https://www.mpgh.net/forum/33-visual-...ipulation.html

    [php]
    Dim s As String = "This is the string sample"
    S = S.Substring(19)
    [/php]

    That will grab the the 5th word (which is 19 characters in)

    [php]
    label1.text = s
    [/php]

    Now label1.text says "Sample"

    Hope that helps, string manipulation is rather easy, and very effective.

    Read the tut, it does through indexing for specific words, etc.

    If you know the word you are trying to parse, you can use .

    [php]
    Dim currentSentence As String = "Sample Test"
    Dim splitSentence() As String = currentSentence.Split(" "c)
    For Each s As String In splitSentence
    If s.Contains("test") Then MsgBox("Found Test")
    Next
    [/php]



    Last edited by NextGen1; 04-19-2010 at 09:26 PM.


     


     


     



    The Most complete application MPGH will ever offer - 68%




  3. The Following User Says Thank You to NextGen1 For This Useful Post:

    Zoom (04-20-2010)

Similar Threads

  1. [Help] Checking a textbox for a word [solved]
    By T0P-CENT in forum Visual Basic Programming
    Replies: 3
    Last Post: 04-16-2011, 10:32 AM
  2. Need help decrypting microsoft word documents
    By Orteez in forum Suggestions, Requests & General Help
    Replies: 2
    Last Post: 11-07-2010, 10:18 AM
  3. I need some words. Help me out
    By Jabuuty671 in forum General
    Replies: 14
    Last Post: 08-14-2010, 11:34 PM
  4. [Help]Replace word in textbox1
    By ppl2pass in forum Visual Basic Programming
    Replies: 4
    Last Post: 05-08-2010, 08:05 AM
  5. Please help , CA with no words ?!
    By Mat17 in forum Combat Arms Help
    Replies: 4
    Last Post: 02-18-2010, 07:46 AM