Home
Register
About
Login
Categories
C#
(13)
VB.NET
(0)
F#
(0)
ASP.NET
(15)
JavaScript
(4)
C++
(0)
C
(0)
Python
(0)
Ruby
(0)
Rails
(0)
J#
(0)
SQL
(0)
VB Script
(0)
HTML
(0)
CSS
(2)
XML
(2)
XSLT
(0)
Unit Testing
(7)
Architecture
(2)
Ajax
(0)
Project Management
(0)
LINQ to SQL
(2)
LINQ
(0)
LINQ to XML
(1)
NHibernate
(0)
Active Record
(0)
Silverlight
(0)
ASP.NET MVC
(0)
Life
(0)
Book Reviews
(0)
WPF
(0)
Extract File Name from URL Using JavaScript
by azamsharp on 7/18/2008 1:21:19 PM
I found this nifty code online that extracts file name from the url using JavaScript code. This can be performed better by using Regular Expressions (any takes?)
function getFileNameFromUrl(url)
{
wholeurl = url;
x = wholeurl.length;
while((wholeurl.substring(x,x-1)) != "/"){ x--; }
return wholeurl.substring(wholeurl.length,x);
}
Refactor it!
will that possibly work man
by gojecks on 9/4/2008 9:13:54 AM
Hi GoJecks, Are you facing any problems with the above code?
by azamsharp on 9/4/2008 9:15:08 AM
Please log in to refactor the code!
Login