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\'
STRTOK and an index operation should do the trick:
str = 'johndoe@hotmail.com'; [name,address] = strtok(str,'@'); address = address(2:end);
Or the last line could also be:
address(1) = '';