Suppose I have a string \'johndoe@hotmail.com\'. I want to store the string before and after \"@\" into 2 separate strings. What would be the easiest method of
\'johndoe@hotmail.com\'
You can use strread:
str = 'johndoe@hotmail.com'; [a b] = strread(str, '%s %s', 'delimiter','@') a = 'johndoe' b = 'hotmail.com'