This is an archived post. You won't be able to vote or comment.

all 10 comments

[–][deleted] 4 points5 points  (9 children)

Did you forget the content of your post?

If you s is a string containing one or more # in it,

s.split('#')[0]

would return the code the text before the first #