I have the following code inside my c# application:-
string[] excludechar = { "|", "\\", "\"", "'", "/", "[", " ]", ":", "<", " >", "+", "=", ",", ";", "?", "*", " @" };
var currentgroupname = curItemSiteName;
for (int i = 0; i < excludechar.Length; i++)
{
if (currentgroupname.Contains(excludechar[i]))
currentgroupname.Replace(excludechar[i], "");
}
site.RootWeb.SiteGroups.Add(currentgroupname)
now in my abive code the currentgroupname
variable which i am passing inside the .ADD
function will have all the special characters i have replaced inside my for loop. so can anyone adivce if i can modify my code so the .Replace will be actually replacing the original string of the currentgroupname
...