0

I want to put some weather in my system and so far its working great. I've been copying the weather stuff from the yahoo website and this is the code

             'Tomorrow Conditions
    startpoint = 0 : endpoint = 0
    _search = String.Empty : _search = "Tomorrow"
    startpoint = _response.IndexOf(_search) + 435
    endpoint = _response.IndexOf("</", startpoint)
    _tomorrow = _response.Substring(startpoint, (endpoint - startpoint)).Trim()

Now the problem I am facing is that depending on which day of the week it is sometimes some of the text is going to be missing in the begging of my words for example instead of "showers/wind" I get "/wind" because i cannot be certain that the weather condition is going to start on the 435th character.but however I am certain that it is always going to be around that area.I am certain that the weather condition is going to be after "</br>". How can i make the code to start readnig text after the "</br>" around "startpoint"

3
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by adam_k
0

Will the description always have a slash / in it?
If so, you can use .Split() on the string and parse it by the slash rather than taking data at a given position.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.