I have replace the words like "a an the " in the given string to the empty space.. this to be in csharp web application
if given string has "c# corner is a very informative site" then result shuld be " c# corner informative site" ,it has to remove is ,a,very words from the given sentences...
Loading
Madhu KPosted Nov 15, 2010, 1:44 AM
// characters that need to replaced.
string[] BadCharacters = { "is ", "a " };
string strReplaced = "";
for (i = 0; i < BadCharacters.Length; i++)
{
if (str1.Contains(BadCharacters[i]))
{
strReplaced = str1.Replace(BadCharacters[i], "");
}
str1 = strReplaced;
}
Response.Write(strReplaced);
Hope this helps you.
CrishPosted Nov 12, 2010, 9:05 AM
use "xyz".Replace() for your solution