c# - How to assign values to an array -


i trying assign invalid characters array , call function checks if entered string text box has invalid characters array in it.

string[] invalidchars = new string[3] ("!", "@","#",)  

i keep getting error under string says string class type , cannot used expression

your syntax needs few fixes. here's correct version.

string[] invalidchars = new string[] { "!", "@", "#" }; 

primarily, need use { } instead of ( ).


Comments

Popular posts from this blog

php - render data via PDO::FETCH_FUNC vs loop -

c# - Avoiding duplicate methods for Task and Task<T> -

javascript - Which segment of a polyline was clicked? -