I have stored a text file into isolated storage, my file is saved in a way of "asdasdasd,asdasdasd", how can I use delimiters to spilt them instead of retrieving the whole string like this:
//Get the Store we created earlier
IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication();
//use a StreamReader to open and read the file
StreamReader readFile = null;
try
{
readFile = new StreamReader(new IsolatedStorageFileStream("SaveFolder\\SavedFile.txt", FileMode.Open, store));
string fileText = readFile.ReadToEnd();
//The control txtRead will display the text entered in the file
textBlock2.Text = fileText;
readFile.Close();
}
catch
{
//For now, a simple catch to make sure they created it first
//we will modify this later
textBlock2.Text = "Need to create directory and the file first.";
}
You can use string.Split method to split string delimited by the specified characters:
Then you can access each substring by an array index, for example:
Note: It would be better to check if substrings array have at least those two elements.