yes.  this was the elegance i was looking for.   thx

Blair Mitchelmore-2 wrote:
> 
> To avoid running split twice, you could do it this way (removes IE5 from 
> compatibility however):
> 
> var file1 = str1.split("\\").pop();
> 
> -blair
> 
> Tombo wrote:
>> this might not be jquery related, but i noticed there are a lot of savvy
>> javascript programmers in this mailing list.
>>
>> i want to grab just the filename and extension from the following string:
>>
>> str1="F:\\Test1\\Test2\\Test3\\test.txt";
>>
>> i want to grab "test.txt"
>>
>> i use this code:
>>
>> file1=(str1.split("\\"))[(str1.split("\\")).length-1];
>>
>>
>> i was wondering if there is a better way to grab that part of the string
>>
>> Thx for any help
> 
> 
> _______________________________________________
> jQuery mailing list
> [email protected]
> http://jquery.com/discuss/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/String-Parsing-tf2376878.html#a6622882
Sent from the JQuery mailing list archive at Nabble.com.


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to