Hi,
Example:
Variable1 = 2013-2017
from this, I need to get all the years from 2013 to 2017.
expected output array should be = 2013, 2014, 2015, 2016, 2017
Hi,
Example:
Variable1 = 2013-2017
from this, I need to get all the years from 2013 to 2017.
expected output array should be = 2013, 2014, 2015, 2016, 2017
we can parse the string e.g. by regex
arrYears = Regex.Matches(YourString,“\d{4}”).Cast(Of Match).Select(Function (m) CInt(m.toString)).toArray
Ensure:
If sorting is needed we can do otherwise first is oldest
arrYearSequence = Enumerable.Range(arrYears (0),arrYears (1)-arrYears (0) + 1).toArray
Thank you, This is working perfectly
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.