Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21714

How to remove everything after last slash(/) including slash itself ?

$
0
0
hi all . i am extracting a list of urls from webbrowser controle but i want to remove everthing after the last slash including the slash . could any one telll me how this can be done? thanks

Example the urls are like this

aHref.href=123456/new-song-album1 and i want to get only this part :123456 then add it to listbox. I want to do this
process in loop for all values of aHref.href.

example:
123456/new-song-album1 ==>123456
882456/new-song-album2 ==>882456

Code:

Private Sub Command2_Click()
Dim doc As HTMLDocument
Dim aHref As HTMLAnchorElement

Set doc = WebBrowser1.Document

For Each aHref In WebBrowser1.Document.All.tags("A")

List1.AddItem aHref.href

Next aHref


End Sub


Viewing all articles
Browse latest Browse all 21714

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>