Go Back   CodingForums.com > :: Server side development > Other server side languages/ issues > Python

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-01-2010, 07:53 PM   PM User | #1
ynotlim
Regular Coder

 
Join Date: Sep 2006
Posts: 131
Thanks: 5
Thanked 0 Times in 0 Posts
ynotlim is an unknown quantity at this point
get filename

how can i get the filename from this string?

string1 = "attachement; filename=test1234.mov"

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

result:
filename = test1234.mov
__________________
---------
Client / Server Side Programmer II
ynotlim is offline   Reply With Quote
Old 09-02-2010, 11:14 AM   PM User | #2
Kakao
Regular Coder

 
Join Date: Mar 2006
Location: Brasília, Brazil
Posts: 153
Thanks: 0
Thanked 0 Times in 0 Posts
Kakao is on a distinguished road
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]
Kakao is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:56 PM.


Advertisement
Log in to turn off these ads.