Hi,
Alternatively, you can use a Regular Expression to get the value, and it will return an matching groups. Regular Expressions sound a bit overkill, but in your example, no knowledge is required.
Code:
using System.Text.RegularExpressions;
string text = "ServiceName=";
MatchCollection matches = Regex.Match(sourceString, text, RegexOptions.SingleLine);
if(matches.Count==0)
//No matches found
else
{
foreach(Match m in matches)
{
//Match is contained at m.Value;
}
}
I hope this helps,
Regards,
Dominic