J
Jon S via DotNetMonster.com
Hi all,
I searching a string to see if "Desc" resides in it, if so then replace it
with "Description". For some reason if it finds "Desc" in the word
"Description" it replaces the "Desc" part of it with "Description thus having
the final outcome of "Descriptionription". Is there a way to have the
replace() method only replace if the entire string is "Desc" only and not
"Desc* " ? Hope this makes sense. Thanks in advance.
if( "Text" == dcSource.ColumnName.ToString() )
{
string changeContent = drSource[dcSource.ColumnName].ToString();
changeContent = changeContent.Replace("Desc", "Description");
drSource[dcSource.ColumnName] = changeContent;
}
I searching a string to see if "Desc" resides in it, if so then replace it
with "Description". For some reason if it finds "Desc" in the word
"Description" it replaces the "Desc" part of it with "Description thus having
the final outcome of "Descriptionription". Is there a way to have the
replace() method only replace if the entire string is "Desc" only and not
"Desc* " ? Hope this makes sense. Thanks in advance.
if( "Text" == dcSource.ColumnName.ToString() )
{
string changeContent = drSource[dcSource.ColumnName].ToString();
changeContent = changeContent.Replace("Desc", "Description");
drSource[dcSource.ColumnName] = changeContent;
}