You can use RegEx (regular expressions). I am not an expert with RegEx, but there is information at
http://www.knowdotnet.com/articles/regereplacementstrings.html[
^]. The regular expression you would need is
"password=\'[a-z]+\'"
. Here is some code to show that this works:
string x = "sdlkfsdal password='edere' dfldskflkds";
Regex rx = new Regex("password=\'([a-z]+)\'");
var r = rx.Match(x);
if (r.Groups.Count > 0)
{
var g1 = r.Groups[0];
var g2 = r.Groups[1];
}
Notice I put
()
around the
"[a-z]+"
, which allows you to get the actual password.