/// To Remove specfic string from Collection of string
///
///
///
///
public static string mRemoveStringFromCollection(string strNames, string sep, string specificStr)
{
List
string strValue = String.Empty;
if (!string.IsNullOrEmpty(strNames))
{
list.AddRange(Regex.Split(strNames, sep));
foreach (string str in list)
{
if (!str.Contains(specificStr))
{
if (string.IsNullOrEmpty(strValue))
{
strValue = str;
}
else
{
strValue = strValue + sep + str;
}
}
}
return strValue;
}
return strNames;
}
No comments:
Post a Comment