Advertisement
KillianMills

insertString.py

Nov 8th, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.34 KB | None | 0 0
  1. import re
  2.  
  3. tester = "DIALER_STANDARD_AP1_2016-11-15.csv"
  4. #tester = tester[:-14]
  5. deck_name = re.search('_A(.+?)_2', tester).group(0)
  6. deck_name = deck_name[1:] # remove the _ start
  7. deck_name = deck_name[:-2] # remove the _2 end
  8. deck_name = deck_name[:2] + "L" + deck_name[2:] # insert a string into the middle of another string
  9. print deck_name
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement