I have 10 data's in string array.In this 10 data, each of the data's could be integer/string/double/DateTime format. based on these 10 datatype we have to find common datatype.

Eg1: string["10","20","3","45"] -> o/p: int.

Eg2: string["10","2o","3","4","5.0","4","56"] -> o/p : float.

Eg3: string["10","20.5","ten","45"] -> o/p: string

有帮助吗?

解决方案

Iterate : TryParse double, TryParse Int, TryParse DateTime, or string. Done.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top