locked
String Functions in VS Express 2012 RRS feed

  • Question

  • I'm looking to take the leap from VS2005 (.NET 2.0) to Windows8 Store Apps, and my skills are limited to Visual Basic. I am stuck at trying to call some simple string functions, specifically InStr and Mid. Can someone please offer some code examples, and what Import would be required?

    Here's how I would code in VB2005 (.NET 2.0). What do I need to do to parse for strings in Windows8?

                myPos = InStr(1, str1, " id=2 ", CompareMethod.Text)
                If myPos > 0 Then
                    myPos2 = InStr(myPos, str1, ">", CompareMethod.Text)
                    If myPos2 > 0 Then
                        strCell = Mid(str1, myPos, myPos2 - myPos)
                        myPos = InStr(1, strCell, " value=", CompareMethod.Text)
                        If myPos > 0 Then
                            strNUM = Mid(strCell, myPos + 7, 1)
                            txtMark.Text = strNUM
                        End If
                    End If
                End If

    Saturday, September 21, 2013 8:46 PM

Answers

All replies