Okay so my code looks kinda like this
// Returns the note of a favorite pown if it exists
string GetFavoriteNote(int id)
{
string notelist = Properties.Settings.Default.FavoriteNotesList;
// If there's a note, return it
if (notelist.Contains("'" + id + ":"))
{
// What to do here?
}
// If there's no note, return an empty string
else
{
return String.Empty;
}
}
Now it’s basically a system where for each id the user can set a note, and it will be saved in this format: 'id:note','id:note',
Now what I want to do is select that note somehow and return it, so I’d have to like select from "'" + id + ":" until the ‘
If anyone knows how to do this, please help me out.
Thanks
Using a Regex seems like the cleanest approach to me:
Alternatively however, you could use string splitting: