You could also use string[] something = text.Split('@')
. Make sure you use single quotes to surround the "@" to store it as a char
type.
This will store the characters up to and including each "@" as individual words in the array. You can then output each (element + System.Environment.NewLine
) using a for loop or write it to a text file using System.IO.File.WriteAllLines([file path + name and extension], [array name])
. If the specified file doesn't exist in that location it will be automatically created.