Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi.
is there any way to update URL with another URL through coding in vb.net in win form??
Posted
Comments
Zoltán Zörgő 24-May-13 1:56am    
What url??? Where??? Why???
Anyway: this question makes no sense.
shashank 1068 24-May-13 2:05am    
i have this url http://www.sat.dundee.ac.uk/xrit/057.0E/MET/2012/12/30/600/2012_12_30_600_MET7-_1_S2_grid.jpeg and in this url 2012_12_30 this is the date i want to update this date to today's date
Zoltán Zörgő 24-May-13 2:34am    
Is this in a string variable, and you want to replace a portion of it?
shashank 1068 24-May-13 2:54am    
i want to replace a portion..
like i want to replace only the date part
Prasad Khandekar 24-May-13 1:58am    
Where do you want to update the URL?

1 solution

Here it is:
VB
Dim subject As String  = "http://www.sat.dundee.ac.uk/xrit/057.0E/MET/2012/12/30/600/2012_12_30_600_MET7-_1_S2_grid.jpeg"
Dim find As String = "\d{4}_\\d{2}_\d{2}"
Dim replace As String = String.Format("{0:yyyy_MM_dd}", DateTime.Now)
Dim result As String = Regex.Replace(subject, find, replace)

But I have the feeling that you want something else you just don't know how to formulate it...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900