Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 516
  • Last Modified:

Visual Basic innertext.contians

My test was a msgbox("SKU Found"), is there away to have it find the word and then grab the digits next to it.


This is inside the innertext, but I would like to extract only 1000001, is this possible, truly need some help with the code, I have spent mutiple hours on the EE forum searching, and managed to get to this point.

SKU #1000001 - GET A DANCE LESSON

If curElement.InnerText.Contains("SKU #")  Then

End If

Open in new window

0
-Geek
Asked:
-Geek
  • 2
1 Solution
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
Assuming there is always a space after the number:
        Dim skuTag As String = "SKU #"
        Dim index As Integer = curElement.InnerText.ToUpper.IndexOf(skuTag)
        If index <> -1 Then

            Dim SKU As String = curElement.InnerText.Substring(index + skuTag.Length).Split(" ")(0)
            MsgBox(SKU)

        End If

Open in new window

0
 
-GeekAuthor Commented:
Is there away to loop and grab all SKU's, I am very sorry I thought I put that in the question.
0
 
-GeekAuthor Commented:
Idle_Mind, thank you for helping here. After thinking about this it would only be fair to ask a new question, as you answered my question.

Thanks,

New Question can be located:

http://www.experts-exchange.com/Programming/Languages/.NET/Visual_Basic.NET/Q_27842436.html
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now