You could use a combination of the substring function and the indexof function to remove everything after the @.
string.substring(indexStart, indexEnd)
string.indexOf(searchvalue, start)
So if you use the result of the indexOf the @, you should be able to get a substring with indexStart 0 and indexEnd the result of the indexOf.
Alternatively, you could just use the functions “substring” and “find” that are already available in Mendix, so you don't have to make custom javascript actions.
You can use a regular expression, so if you use replaceFirst, the following should work.
replaceFirst('raviprakash@gmail.com', '@.*$', '')