in reply to RegEx to find the index of the character '@' in an Email address
Or is there any other method using substr?
Sure. You can use index to find the index of the first occurrence of @, and the use substr to extract everything before it.