Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- s = "name:Sean;A-whole-bunch-of-othershit"
- def extract_name(string_with_name):
- # get everything after "name:" - only works if it starts with "name:"
- name_part, other_part = string_with_name.split(";")
- name = name_part[5:] # remove name: and just save the actual name
- return name, other_part
- name, remainder = extract_name(s)
- print(name) # Sean
- print(remainder) # A-whole-bunch-of-othershit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement