CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   Python (http://www.codingforums.com/forumdisplay.php?f=46)
-   -   get filename (http://www.codingforums.com/showthread.php?t=203782)

ynotlim 09-01-2010 07:53 PM

get filename
 
how can i get the filename from this string?

string1 = "attachement; filename=test1234.mov"

filename = string1.parse(.......)

result:
filename = test1234.mov

Kakao 09-02-2010 11:14 AM

if the equal sign will always be present then you split the string at it and get the second part:

Code:

string1 = "attachement; filename=test1234.mov"
filename = string1.split('=')[1]



All times are GMT +1. The time now is 05:27 PM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.