Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

remove http:// charcters from string 2

Status
Not open for further replies.

Richey

Technical User
Aug 29, 2000
121
GB
hi

i want my users to enter a web address as for example not
if they do enter http:// at the start how can i best remove it before sending the result to the database ?

thanks

I thought of doing something like

Code:
left(str, 7)
if str = "[URL unfurl="true"]http://"[/URL] then
a = len(str)
replace str(str, mid(str,8,a-7))
 
mmmmmm...........yeah - now why didn't i think of that !

thanks.
 
juat try it out and let's us know if there are any exceptions for that too work and then we can come up with some string manipulations...

-DNG
 
>>replace(str,"
>>juat try it out and let's us know if there are any exceptions for that too work and then we can come up with some string manipulations...


just one that i can see and that is that replace is case sensitive. there are 2 approaches:
1. Lcase all the items and replace the http://
2. use RegExes


Known is handfull, Unknown is worldfull
 
I agree with vbkris and Sheco on the "s" that in any dynamic situation where the value can appear as multiple things RegEx is your best bet. This would be a good starting point to utilize the manipulative and validation powers of Regular Expressions if you have not prior also.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top