I am looking for a way to get all of the letters in a string before a : but I have no idea on where to start. Would I use regex? If so how?
string = \"Userna
Just use the split function. It returns a list, so you can keep the first element:
split
>>> s1.split(':') ['Username', ' How are you today?'] >>> s1.split(':')[0] 'Username'