Python Forum

Full Version: extract particular strings into a variable
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I have a requirement to get the string data like below.

str = "dsrc, combo, dsrc_hist, mapping, combo_hist"

If a particular value contains "hist" needs to assign to one variable and if not "hist" send him to another variable.

var1 = "dsrc_hist, combo_hist"
var2 = "dsrc, combo, mapping"

Can you please help me to achieve the above functionality?

Thx in advance
Please show what you have tried so far, any errors, and specific location where you need help.
Hello,
Hope you are well.

I can assist you with the requirement.
Can we have a detailed discussion regarding the same?
I can be reached at mail/skype:- [email protected]

Hoping to listen from you soon.
BR,
Sofia
Thanks.. I resolved it my own

Thx,
Lokesh