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

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

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

The canvas has been tainted by cross-origin data in chrome only -