Hi,
I face a scenario where I need the Highest number out of an Array of Strings.
Array of Strings = {202205102345, 202205112210, 202205123375}
I used the function,
GetMax = ArrayofStrings.Max(function(e) convert.toint32(e))
Where Getmax is Int32.
I get only the last 2 digits of the highest number for GetMax. In the above case, getmax =75
But I need the entire Value (ie. 202205123375)
Can someone help.
The max value for Int32 is 2,147,483,647. Your value of 202,205,123,375 is too big for the variable to hold. As suggested by the others, use Int64 instead.
Declare GetMax as Int64 and then assign it as below: GetMax = ArrayofStrings.Max(Function(e) Convert.ToInt64(e))