Consider the following two strings:
var str = "Extract Me @ Leave Me";
var str2 = "Not This @ Yes, This";
Imagine a function named extractString() that can work like this:
extractString("frontOf", "@", str); // => Extract Me
extractString("behindOf", "@", str2); // => Yes, This
Or if you prefer:
extractString("frontof @", str); // => Extract Me
extractString("behindof @", str2); // => Yes, This
How would you implement the extractString() function? Can you create it for me?