JSFiddle - React, Tailwind, and code Playground

JavaScript

var haystack = "the cow ran around and subsequently went @moo";

if (haystack.indexOf("@")) {
    alert(haystack.substr(haystack.indexOf("@") + 1));
}