PDA

View Full Version : [SOLVED] [python]Best way to get string after certain characters?



days_of_ruin
May 28th, 2008, 11:10 PM
IconTheme=Human
What would be the best way to get whatever is past the right most "="?

Lau_of_DK
May 28th, 2008, 11:16 PM
IconTheme=Human
What would be the best way to get whatever is past the right most "="?

How about




line.split("=")[1]



Edit: If line contains "description=value", then .split("=") will break it up into to strings, line[0] which contains everything before "=" and line[1] which contains everything after "=", you can split with any character you want.

/Lau

days_of_ruin
May 28th, 2008, 11:24 PM
Thanks!I knew there had to be a simple way to do this.
:guitar: