KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
This works fine: var expectedType = typeof(string); object value = "..."; if (value.GetType().IsAssignableFrom(expectedType)) { ... } But how do I check if value is a string array without setting expectedType to typeof(string[]) ? I want to do something like: var expectedType = typeof(string); object value = new[] {"...", "---"}; if (value.GetType().IsArrayOf(expectedType)) // <--- { ... } Is this possible?
Tags (comma-separated)
Save Edits
Cancel