title: How to take a string, search for a certain character, and return a string with everything before the character?
body: <p>I'm a bit new to programming, and for an in class project, I have to take a user-inputted email, find everything before the @ symbol, and return it as a username. The part I'm having trouble on is finding the characters before the @, with it being variable length. As far as I can tell, most methods rely on a preset string length.</p>
  <p><a href="https://i.stack.imgur.com/5734D.png" rel="nofollow noreferrer">My current code</a></p>