S
Sreenivas
I am just peeping through BlogEngine.NET source code and got a doubt.
In Util.cs file ,there is a function called “RemoveIllegalCharacters
“ ,which removes spaces and diacritics and illegal chars in title of a
post such as ! @ : etc.. And replaces them with string.Empty.
function is given below.
public static string RemoveIllegalCharacters(string text)
{
if (string.IsNullOrEmpty(text))
return text;
text = text.Replace(":", string.Empty);
text = text.Replace("/", string.Empty);
text = text.Replace("?",
string.Empty);
return text;
}
My doubt is why don’t they use StringBuilder in place of string object
and stop polluting CIL with ‘ldstr ‘object?
Here, Is string a deliberate choice to StringBuilder or am I wrong?
Any insights!
TIA,
Sreenivas
In Util.cs file ,there is a function called “RemoveIllegalCharacters
“ ,which removes spaces and diacritics and illegal chars in title of a
post such as ! @ : etc.. And replaces them with string.Empty.
function is given below.
public static string RemoveIllegalCharacters(string text)
{
if (string.IsNullOrEmpty(text))
return text;
text = text.Replace(":", string.Empty);
text = text.Replace("/", string.Empty);
text = text.Replace("?",
string.Empty);
return text;
}
My doubt is why don’t they use StringBuilder in place of string object
and stop polluting CIL with ‘ldstr ‘object?
Here, Is string a deliberate choice to StringBuilder or am I wrong?
Any insights!
TIA,
Sreenivas