Here is the code, but it telling me that the 'strNameArtist1 = '_' line is a read-only, and I cannot change the current index in the string.. so what do I do, how can I make this work? Am I even going about this the right way?
You can't access parts of a string using an index. Try the Replace method.
string strNameArtist1 = Server.UrlDecode(Request.QueryString["nameartist"].Replace("'", "''"));for (int i = 0; i < strNameArtist1.Length; ++i)
{
if (char.IsLetterOrDigit(strNameArtist1[i]) == false)
strNameArtist1[i] = '_'; // complile error says cannot assign to, it is read only... ??
}
0 comments:
Post a Comment