Crash when trying to parse string

mattdarnell

Member
Licensed User
Longtime User
Aloha,

I am trying to parse the <description> from the Dan Patrick feed.

I am able to load the following into a string, this is the log output:
Eli Manning on Hakeem Nicks' health, Peyton's start and Giants' attitude.<img src="http://feeds.feedburner.com/~r/services/podcasting/danpatrick/rss/~4/htEW80aCkRI" height="1" width="1"/>

What would be the best way to drop everything in the '<img src....' portion?

I get crashes no matter what string manipulation I try.

The actual feed can be found here:
The Dan Patrick Show: Podcast
If you do view source, it looks a bit different.

Thanks for the help.

Aloha,
Matt
 
Last edited:

mattdarnell

Member
Licensed User
Longtime User
This code works just fine, it drops everything after "&lt". I added the quotation marks to make sure that wasn't the issue. Let me check the previous code now that I have slept!

Dim i,k As String
Dim j As Int
i = "Eli Manning on, " & QUOTE & "Peyton's" & QUOTE & " start and.&lt Giants' attitude"
j=i.indexof("&lt")
k=i.SubString2(0,j)
Log(i)
Log(k)

-Matt
 
Upvote 0

mattdarnell

Member
Licensed User
Longtime User
Ended up being a run time error where I was trying to get the substring when using -1 as one of the inputs.

I see you can put break points into the IDE, they don't seem to stop the application. In VB6 you could stop at a break point, hover over a variable and it would give you the value.

-Matt
 
Upvote 0

mc73

Well-Known Member
Licensed User
Longtime User
-1 is the result of indexOf when the search string is not found, same thing holds true with vb6.

Testing your given string, however, no error was received:

B4X:
Dim i,k As String 
Dim j As Int 
i="Eli Manning on Hakeem Nicks' health, Peyton's start and Giants' attitude.&lt"
j=i.IndexOf ("&lt")
k=i.SubString2 (0,j)
Msgbox(k,"ok")
 
Upvote 0
Top